rearrange builtins
This commit is contained in:
12
builtins/typeof.go
Normal file
12
builtins/typeof.go
Normal file
@@ -0,0 +1,12 @@
|
||||
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())}
|
||||
}
|
||||
Reference in New Issue
Block a user