F#属性
在F#中,属性用于启用程序代码构造的元数据。属性可以应用于任何结构,如函数、模块、方法和类型。
语法:
[<target:attribute-name(arguments)>]
F#属性示例
open System [<Obsolete("Do not use. Use newFunction instead.")>] let updateSystem() = printf "updating..." updateSystem
输出:
attributes.fs(118,1): warning FS0044: This construct is deprecated. Do not use. Use newFunction instead.
祝学习愉快! (发现内容有误?请选中要编辑的内容 -> 右键 -> 修改 -> 提交!帮助我们改进教程质量)
精选教程推荐
👇 以下精选教程可能对您有帮助,拓展您的技术视野
暂无学习笔记,成为第一个分享的人吧!
您的笔记将帮助成千上万的学习者