aboutsummaryrefslogtreecommitdiff
path: root/go/src/step7_quote
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-10-09 18:05:30 -0500
committerJoel Martin <github@martintribe.org>2014-10-09 18:05:30 -0500
commitd667a1bb2e7294f8722bb31f1e6e8207b971c913 (patch)
treec79dff4e32c3d1a73369ba3203b435f0212aab45 /go/src/step7_quote
parent82efc357ba67da1eaf35ca92b6f249a344aae8d5 (diff)
downloadmal-d667a1bb2e7294f8722bb31f1e6e8207b971c913.tar.gz
mal-d667a1bb2e7294f8722bb31f1e6e8207b971c913.zip
go: add stepA_more. try* and more core functions.
Diffstat (limited to 'go/src/step7_quote')
-rw-r--r--go/src/step7_quote/step7_quote.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/go/src/step7_quote/step7_quote.go b/go/src/step7_quote/step7_quote.go
index 8642cf0..4083354 100644
--- a/go/src/step7_quote/step7_quote.go
+++ b/go/src/step7_quote/step7_quote.go
@@ -156,9 +156,7 @@ func EVAL(ast MalType, env EnvType) (MalType, error) {
ast = a2
}
case "fn*":
- fn := MalFunc{EVAL, a2, env, a1, false,
- func(outer EnvType, binds []MalType, exprs []MalType) (EnvType, error) {
- return NewEnv(outer, binds, exprs) }}
+ fn := MalFunc{EVAL, a2, env, a1, false, NewEnv}
return fn, nil
default:
el, e := eval_ast(ast, env)
@@ -167,7 +165,7 @@ func EVAL(ast MalType, env EnvType) (MalType, error) {
if MalFunc_Q(f) {
fn := f.(MalFunc)
ast = fn.Exp
- env, e = NewEnv(fn.Env, fn.Params.(List).Val, el.(List).Val[1:])
+ env, e = NewEnv(fn.Env, fn.Params, List{el.(List).Val[1:]})
if e != nil { return nil, e }
} else {
fn, ok := f.(func([]MalType)(MalType, error))