hyrule
hyrule copied to clipboard
Consider adding dynamic/special variables to Hy
Lisp originally used dynamic variables, instead of the lexical variables used in Python. They're still the norm in Emacs Lisp, and useful enough sometimes that they're still available optionally in Common Lisp (as "special variables"). For those of you not familiar with Elisp or Common Lisp, they're basically Clojure's thread-local vars.
I also think that a dynamic let
would be much easier to implement. The dynamic version doesn't need closures, and could be compiled into a with
statement. After purging the broken lexical let
from Hy hylang/hy#1056, we could replace it with a dynamic one that has the same semantics as Elisp's let
(or Clojure's binding
form).