xgo/objects/builtin_copy.go
2019-01-08 23:17:42 -08:00

12 lines
234 B
Go

package objects
import "errors"
func builtinCopy(args ...Object) (Object, error) {
// TODO: should multi arguments later?
if len(args) != 1 {
return nil, errors.New("wrong number of arguments")
}
return args[0].Copy(), nil
}