13 lines
263 B
Go
13 lines
263 B
Go
package builtins
|
|
|
|
import "monkey/object"
|
|
|
|
// TypeOf ...
|
|
func TypeOf(args ...object.Object) object.Object {
|
|
if len(args) != 1 {
|
|
return newError("wrong number of arguments. got=%d, want=1", len(args))
|
|
}
|
|
|
|
return &object.String{Value: string(args[0].Type())}
|
|
}
|