Example #1
0
// Return a new namespace containing all builtin functions.
func defineBuiltins() BuiltinList {
	builtins := []types.FuCallable{
		types.NewVariadicFunction("println", 0, -1, fn_println),
		types.NewVariadicFunction("mkdir", 0, -1, fn_mkdir),
		types.NewVariadicFunction("remove", 0, -1, fn_remove),

		types.NewFixedFunction("build", 3, fn_build),

		// node factories
		types.NewFixedFunction("FileNode", 1, fn_FileNode),
		types.NewFixedFunction("ActionNode", 1, fn_ActionNode),
	}
	return BuiltinList{builtins}
}
Example #2
0
func init() {
	methodsFinderNode = make(types.ValueMap)
	methodsFinderNode["prune"] = types.NewVariadicFunction(
		"prune", 0, -1, meth_FinderNode_prune)
}