xgo/objects/builtins.go

111 lines
1.5 KiB
Go
Raw Normal View History

2019-01-09 10:17:42 +03:00
package objects
2019-01-18 20:19:45 +03:00
// Builtins contains all default builtin functions.
// Use GetBuiltinFunctions instead of accessing Builtins directly.
var Builtins = []*BuiltinFunction{
2019-01-09 10:17:42 +03:00
{
Name: "len",
Value: builtinLen,
2019-01-09 10:17:42 +03:00
},
{
Name: "copy",
Value: builtinCopy,
2019-01-09 10:17:42 +03:00
},
{
Name: "append",
Value: builtinAppend,
2019-01-09 10:17:42 +03:00
},
{
Name: "string",
Value: builtinString,
},
{
Name: "int",
Value: builtinInt,
},
{
Name: "bool",
Value: builtinBool,
},
{
Name: "float",
Value: builtinFloat,
},
{
Name: "char",
Value: builtinChar,
},
2019-01-18 12:43:46 +03:00
{
Name: "bytes",
Value: builtinBytes,
2019-01-18 12:43:46 +03:00
},
{
Name: "time",
Value: builtinTime,
},
{
Name: "is_int",
Value: builtinIsInt,
},
{
Name: "is_float",
Value: builtinIsFloat,
},
{
Name: "is_string",
Value: builtinIsString,
},
{
Name: "is_bool",
Value: builtinIsBool,
},
{
Name: "is_char",
Value: builtinIsChar,
},
2019-01-18 12:43:46 +03:00
{
Name: "is_bytes",
Value: builtinIsBytes,
2019-01-18 12:43:46 +03:00
},
{
Name: "is_array",
Value: builtinIsArray,
},
{
Name: "is_immutable_array",
Value: builtinIsImmutableArray,
},
{
Name: "is_map",
Value: builtinIsMap,
},
{
Name: "is_immutable_map",
Value: builtinIsImmutableMap,
},
{
Name: "is_time",
Value: builtinIsTime,
},
{
Name: "is_error",
Value: builtinIsError,
},
{
Name: "is_undefined",
Value: builtinIsUndefined,
},
{
Name: "is_function",
Value: builtinIsFunction,
},
{
Name: "is_callable",
Value: builtinIsCallable,
},
2019-01-28 05:39:45 +03:00
{
Name: "type_name",
Value: builtinTypeName,
2019-01-28 05:39:45 +03:00
},
2019-01-09 10:17:42 +03:00
}