-
Notifications
You must be signed in to change notification settings - Fork 31
let*: lexical binding special form that doesn't create a recur point #25
Comments
My first approach was to do simply translate the following:
Into this:
But that won't handle the recur correctly. OTOH, it's better than not having a Implementing made me realize that I don't need to go through the |
OK, I have implementation attempt no. 1 committed. For now it's called Implementation calls There are no changes to the frames or stack, so the An outstanding issue is that |
Seems that the environment array was designed with this purpose in mind. So However, some benchmarking has shown that this doesn't actually help. Bash segfaults at the same place even though memory has been supposedly "unset". But we're doing the right thing now. I'll leave this with the name |
I think the behavior of our new For example: ((let (x 1) (fn () x))) ;; explodes because x can't be closed over I propose we rename the |
Assuming that in the above example
let
is a macro built atop ourfn
,(recur (- x 1))
would recur to afn
somewhere in the expansion of thelet
, not the enclosing, visible, desiredfn
.Thus, we need
let*
so that we have the ability to establish a new lexical environment without also creating a recur frame.We may also want to support sequence destructuring on the left-hand side of
let*
's binding form, which should be a list with an even number of things in it.The text was updated successfully, but these errors were encountered: