aboutsummaryrefslogtreecommitdiff
path: root/go/src/core
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-10-09 18:27:47 -0500
committerJoel Martin <github@martintribe.org>2014-10-09 18:27:47 -0500
commitad7e866ea1d4d035d876e58bca681a72099449af (patch)
treecbd73a7cda5adc4aba7293231ab0efa3f107edb0 /go/src/core
parentd667a1bb2e7294f8722bb31f1e6e8207b971c913 (diff)
downloadmal-ad7e866ea1d4d035d876e58bca681a72099449af.tar.gz
mal-ad7e866ea1d4d035d876e58bca681a72099449af.zip
go: add readline.go that wraps libreadline/libedit
Diffstat (limited to 'go/src/core')
-rw-r--r--go/src/core/core.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/go/src/core/core.go b/go/src/core/core.go
index b3961e1..cd63930 100644
--- a/go/src/core/core.go
+++ b/go/src/core/core.go
@@ -10,6 +10,7 @@ import (
. "types"
"reader"
"printer"
+ "readline"
)
// Errors/Exceptions
@@ -150,6 +151,8 @@ var NS = map[string]MalType{
"read-string": func(a []MalType) (MalType, error) {
return reader.Read_str(a[0].(string)) },
"slurp": slurp,
+ "readline": func(a []MalType) (MalType, error) {
+ return readline.Readline(a[0].(string)) },
"<": func(a []MalType) (MalType, error) {
return a[0].(int) < a[1].(int), nil },