rearrange builtins
This commit is contained in:
18
object/builtin.go
Normal file
18
object/builtin.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package object
|
||||
|
||||
import "fmt"
|
||||
|
||||
type Builtin struct {
|
||||
Name string
|
||||
Fn BuiltinFunction
|
||||
}
|
||||
|
||||
func (b *Builtin) Type() ObjectType {
|
||||
return BUILTIN_OBJ
|
||||
}
|
||||
func (b *Builtin) Inspect() string {
|
||||
return fmt.Sprintf("<built-in function %s>", b.Name)
|
||||
}
|
||||
func (b *Builtin) String() string {
|
||||
return b.Inspect()
|
||||
}
|
||||
Reference in New Issue
Block a user