Skip to content

Commit

Permalink
puts and end
Browse files Browse the repository at this point in the history
  • Loading branch information
RoBaertschi committed Mar 29, 2024
1 parent 4b44402 commit 17d98f3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion evaluator/builtins.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package evaluator

import "monkey/object"
import (
"fmt"
"monkey/object"
)

func wrongArgumentAmount(want, got int) object.Object {
return newError("wrong number of arguments. got=%d, want=%d", got, want)
Expand Down Expand Up @@ -102,4 +105,13 @@ var builtins = map[string]*object.Builtin{

},
},
"puts": {
Fn: func(args ...object.Object) object.Object {
for _, arg := range args {
fmt.Println(arg.Inspect())
}

return NULL
},
},
}

0 comments on commit 17d98f3

Please sign in to comment.