aboutsummaryrefslogtreecommitdiff
path: root/go/src/step5_tco
diff options
context:
space:
mode:
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