-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
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
Change root binding of Vars #332
Labels
Milestone
Comments
jfacorro
added a commit
that referenced
this issue
Jul 11, 2017
jfacorro
added a commit
that referenced
this issue
Oct 28, 2017
17 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are some functions/macros that rely on being able to change the root binding of Vars (e.g.
with-redefs-fn
). In Clojerl the root binding for aVar
is returned by a function with a__val
suffix, the compiler makes sure the root binding is always a literal. When theVar
is a function the root binding is theVar
itself, and also a function with the same name is generated (e.g.#'clojure.core/inc
is backed by the functionsinc__val/0
, which returns#'clojure.core/inc
itelf, andinc/1
).Alternatives:
def
: would mean the whole module is re-compiled, which is somewhat expensive in some cases.ETS
: introducing another indirection will make accessing the root binding slower for all Vars.Var
s could be changed on a process basis.Related tests:
The text was updated successfully, but these errors were encountered: