mirror of
https://github.com/kanaka/mal.git
synced 2024-08-17 09:40:21 +03:00
mal impl: spare an environment in implementation of do
This commit is contained in:
parent
e4109e6795
commit
6d58903539
@ -52,8 +52,7 @@
|
||||
(LET (new-env env) (nth ast 1) (nth ast 2))
|
||||
|
||||
(= 'do a0)
|
||||
(let* [el (eval-ast (rest ast) env)]
|
||||
(nth el (- (count el) 1)))
|
||||
(nth (eval-ast (rest ast) env) (- (count ast) 2))
|
||||
|
||||
(= 'if a0)
|
||||
(if (EVAL (nth ast 1) env)
|
||||
|
@ -52,8 +52,7 @@
|
||||
(LET (new-env env) (nth ast 1) (nth ast 2))
|
||||
|
||||
(= 'do a0)
|
||||
(let* [el (eval-ast (rest ast) env)]
|
||||
(nth el (- (count el) 1)))
|
||||
(nth (eval-ast (rest ast) env) (- (count ast) 2))
|
||||
|
||||
(= 'if a0)
|
||||
(if (EVAL (nth ast 1) env)
|
||||
|
@ -79,8 +79,7 @@
|
||||
(EVAL (QUASIQUOTE (nth ast 1)) env)
|
||||
|
||||
(= 'do a0)
|
||||
(let* [el (eval-ast (rest ast) env)]
|
||||
(nth el (- (count el) 1)))
|
||||
(nth (eval-ast (rest ast) env) (- (count ast) 2))
|
||||
|
||||
(= 'if a0)
|
||||
(if (EVAL (nth ast 1) env)
|
||||
|
@ -95,8 +95,7 @@
|
||||
(MACROEXPAND (nth ast 1) env)
|
||||
|
||||
(= 'do a0)
|
||||
(let* [el (eval-ast (rest ast) env)]
|
||||
(nth el (- (count el) 1)))
|
||||
(nth (eval-ast (rest ast) env) (- (count ast) 2))
|
||||
|
||||
(= 'if a0)
|
||||
(if (EVAL (nth ast 1) env)
|
||||
|
@ -106,8 +106,7 @@
|
||||
(EVAL (nth a2 2) (new-env env [(nth a2 1)] [exc])))))))
|
||||
|
||||
(= 'do a0)
|
||||
(let* [el (eval-ast (rest ast) env)]
|
||||
(nth el (- (count el) 1)))
|
||||
(nth (eval-ast (rest ast) env) (- (count ast) 2))
|
||||
|
||||
(= 'if a0)
|
||||
(if (EVAL (nth ast 1) env)
|
||||
|
@ -106,8 +106,7 @@
|
||||
(EVAL (nth a2 2) (new-env env [(nth a2 1)] [exc])))))))
|
||||
|
||||
(= 'do a0)
|
||||
(let* [el (eval-ast (rest ast) env)]
|
||||
(nth el (- (count el) 1)))
|
||||
(nth (eval-ast (rest ast) env) (- (count ast) 2))
|
||||
|
||||
(= 'if a0)
|
||||
(if (EVAL (nth ast 1) env)
|
||||
|
Loading…
Reference in New Issue
Block a user