xgo/objects/builtin_copy.go

13 lines
234 B
Go
Raw Normal View History

2019-01-09 10:17:42 +03:00
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
}