文档文档

系统内置函数

Flux 包含许多预赋值。这些预赋值在各种内置包的源文件中定义。

当内置值无法在 Flux 中表达时,其值可以由宿主环境定义。所有这些值都必须具有相应的 builtin 语句来声明内置值的存在和类型。

BuiltinStatement = "builtin" identifier ":" TypeExpression .
TypeExpression   = MonoType ["where" Constraints] .

MonoType     = Tvar | BasicType | ArrayType | StreamType | VectorType | RecordType | FunctionType .
Tvar         = "A"  "Z" .
BasicType    = "int" | "uint" | "float" | "string" | "bool" | "time" | "duration" | "bytes" | "regexp" .
ArrayType    = "[" MonoType "]" .
StreamType   = "stream" "[" MonoType "]" .
VectorType   = "vector" "[" MonoType "]" .
RecordType   = ( "{" [RecordTypeProperties] "}" ) | ( "{" Tvar "with" RecordTypeProperties "}" ) .
FunctionType = "(" [FunctionTypeParameters] ")" "=>" MonoType .

RecordTypeProperties = RecordTypeProperty { "," RecordTypeProperty } .
RecordTypeProperty   = Label ":" MonoType .
Label = identifier | string_lit

FunctionTypeParameters = FunctionTypeParameter { "," FunctionTypeParameter } .
FunctionTypeParameter = [ "<-" | "?" ] identifier ":" MonoType .

Constraints = Constraint { "," Constraint } .
Constraint  = Tvar ":" Kinds .
Kinds       = identifier { "+" identifier } .
示例
builtin filter : (<-tables: stream[T], fn: (r: T) => bool) => stream[T]

此页是否对您有帮助?

感谢您的反馈!


Flux 的未来

Flux 即将进入维护模式。您可以继续像目前一样使用它,而无需对代码进行任何更改。

阅读更多

现已全面上市

InfluxDB 3 Core 和 Enterprise

快速启动。更快扩展。

获取更新

InfluxDB 3 Core 是一个开源、高速、近实时数据引擎,可实时收集和处理数据,并将其持久化到本地磁盘或对象存储。InfluxDB 3 Enterprise 构建在 Core 的基础上,增加了高可用性、读取副本、增强的安全性以及数据压缩,从而实现更快的查询和优化的存储。InfluxDB 3 Enterprise 的免费层可供非商业家庭或业余爱好者使用。

有关更多信息,请查看