xgo/objects/builtin_print.go

18 lines
245 B
Go
Raw Normal View History

2019-01-09 10:17:42 +03:00
package objects
import (
"fmt"
)
func builtinPrint(args ...Object) (Object, error) {
for _, arg := range args {
2019-01-18 12:43:46 +03:00
if str, ok := arg.(*String); ok {
fmt.Println(str.Value)
} else {
fmt.Println(arg.String())
}
2019-01-09 10:17:42 +03:00
}
return nil, nil
}