aboutsummaryrefslogtreecommitdiff
path: root/go/src/step5_tco
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-10-09 22:10:15 -0500
committerJoel Martin <github@martintribe.org>2015-01-06 21:57:02 -0600
commit1771ab50b87c745181e4e30f94b63e3f23d33dac (patch)
treec1c9b5d80ba9261c5f16bab1b52c1bb0f559407c /go/src/step5_tco
parentf2544a9467ea032aff505b3ced3b4b3510a828fe (diff)
downloadmal-1771ab50b87c745181e4e30f94b63e3f23d33dac.tar.gz
mal-1771ab50b87c745181e4e30f94b63e3f23d33dac.zip
go: update README. Backport Func usage.
Diffstat (limited to 'go/src/step5_tco')
-rw-r--r--go/src/step5_tco/step5_tco.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/go/src/step5_tco/step5_tco.go b/go/src/step5_tco/step5_tco.go
index 344a533..9e176bb 100644
--- a/go/src/step5_tco/step5_tco.go
+++ b/go/src/step5_tco/step5_tco.go
@@ -133,9 +133,9 @@ func EVAL(ast MalType, env EnvType) (MalType, error) {
env, e = NewEnv(fn.Env, fn.Params, List{el.(List).Val[1:],nil})
if e != nil { return nil, e }
} else {
- fn, ok := f.(func([]MalType)(MalType, error))
+ fn, ok := f.(Func)
if !ok { return nil, errors.New("attempt to call non-function") }
- return fn(el.(List).Val[1:])
+ return fn.Fn(el.(List).Val[1:])
}
}
@@ -164,7 +164,7 @@ func rep(str string) (MalType, error) {
func main() {
// core.go: defined using go
for k, v := range core.NS {
- repl_env.Set(k, v)
+ repl_env.Set(k, Func{v.(func([]MalType)(MalType,error)),nil})
}
// core.mal: defined using the language itself