We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eval
Thanks for creating mal!
mal
I'm playing with your python implementation. I'm a bit confused with the following behavior.
(do (def! x 0) (let* (x 10000) (eval 'x))) ; => 0
In the python implementation stepA, eval always refers to the global environment repl_env. The source code is the following.
stepA
repl_env
repl_env.set(types._symbol('eval'), lambda ast: EVAL(ast, repl_env))
QUESTION Is this intended behavior? In both emacs-lisp and common-lisp, the equivalent code yields 100.
100
(progn (defvar x) (setf x 0) (let ((x 10000)) (eval 'x))) ; => 10000
The text was updated successfully, but these errors were encountered:
Sorry, I overlooked. It's specified in one test tests/step6_file.mal.
tests/step6_file.mal
;; Checking that eval does not use local environments. (def! a 1) ;=>1 (let* (a 2) (eval (read-string "a"))) ;=>1
I wonder why this design though.
Sorry, something went wrong.
No branches or pull requests
Thanks for creating
mal
!I'm playing with your python implementation. I'm a bit confused with the following behavior.
In the python implementation
stepA
,eval
always refers to the global environmentrepl_env
. The source code is the following.QUESTION Is this intended behavior? In both emacs-lisp and common-lisp, the equivalent code yields
100
.The text was updated successfully, but these errors were encountered: