Re: Better then loop/iterate?
Posted: Tue Sep 22, 2009 4:53 pm
I guess mine in better: http://github.com/ks/X.LET-STARdmitry_vk wrote:There is a metabang-bind project. It does what you describe and is extensible.Jasper wrote:I have been a little annoyed by this: Having flets, lets, macrolets and symbol-macrolets separate all the time has disadvantages.
1) More nested then need be, implying more parenthesis, more depth of indentation.
2) Sometimes need lets or flets in some specific order, causing more nesting.
So it might be better to use macros that create all these macros at the same time, and it seems to be the only disadvantage of that is that it punishes the user a little less when he doesn't create sub functions fast enough. I don't think that is worth it; programmers need to recognize that themselves anyway.
There are a bunch of ways to do this:
- With a macro with a specific variable(of any *let) creation area. The umac this thread was begun with somewhat does that.(Looking at the source code, i see i didn't write it so it can fix (2) currently, easily fixed, and then it'll do it.) Advantages is clear distinction between variables and body, and separate namespace for 'macros to create variables'.(def-umac) You could make a with-slots for the umac, for instance. (maybe not so inferior to iterate after all.)
- An iterate-like approach, working in a scope-like manner. here the advantage is that regular macros can make variables. It likely needs a 'scope-transparant'
