xgo/objects/builtins.go

73 lines
893 B
Go
Raw Normal View History

2019-01-09 10:17:42 +03:00
package objects
// Builtins contains all known builtin functions.
2019-01-09 10:17:42 +03:00
var Builtins = []struct {
Name string
2019-01-17 12:56:05 +03:00
Func CallableFunc
2019-01-09 10:17:42 +03:00
}{
{
Name: "print",
Func: builtinPrint,
},
{
Name: "len",
Func: builtinLen,
},
{
Name: "copy",
Func: builtinCopy,
},
{
Name: "append",
Func: builtinAppend,
},
{
Name: "string",
Func: builtinString,
},
{
Name: "int",
Func: builtinInt,
},
{
Name: "bool",
Func: builtinBool,
},
{
Name: "float",
Func: builtinFloat,
},
{
Name: "char",
Func: builtinChar,
},
{
Name: "is_int",
Func: builtinIsInt,
},
{
Name: "is_float",
Func: builtinIsFloat,
},
{
Name: "is_string",
Func: builtinIsString,
},
{
Name: "is_bool",
Func: builtinIsBool,
},
{
Name: "is_char",
Func: builtinIsChar,
},
{
Name: "is_error",
Func: builtinIsError,
},
{
Name: "is_undefined",
Func: builtinIsUndefined,
},
2019-01-09 10:17:42 +03:00
}