在F#中,属性用于启用程序代码构造的元数据。属性可以应用于任何结构,如函数、模块、方法和类型。
语法:
[<target:attribute-name(arguments)>]
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.
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)