I thought I might want to compile the following into the nested block above:
(let (x 1)
(let (x 2)
x))
I can do that without the nested blocks, but this form seems easier to generate recursively from lisp’s AST. I prefer to let the Elixir compiler do the heavy duty AST manipulation, and in any case I guess those two nested blocks will end up collapsed any way (and yes, if I weren’t so lazy I’d collapse them myself). Is there any serious problem with this approach?
I would just leave the block’s in, I do that anyway and have not noticed anything odd in the final code generation that could affect speed.
/me uses lots and lots of __block__'s in their macro’s, mostly to add line and typing information to constants like integers and such that have malformed non 3-tuple AST nodes
wow! thats cool. Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.
with regards
miles smith