On Wed, May 20, 2009 at 8:14 AM, Konrad Hinsen <konrad.hin...@laposte.net> wrote: > Here is another solution that I consider preferable to the use of > load.
Konrad, this is an interesting approach, and it does feel like a better way to organize similar modules than using load. However, there seems to be one way that this solution falls short of the load-and-redefine technique. Imagine if, in the example above, the function that you want to set up for extension is print-grav-stats. I don't think that will work with your method because print-grav-stats refers to variables that would not be in scope when the macro expands. If there were a way to declare all the variables in the body of the macro BEFORE the let, and then the definitions, I think that might fix it, but I'm not totally sure how to do that. If you don't have side effects in forms, you can simply execute the forms before the let, thus ensuring all vars are in scope. I think just changing expansion to: (list (list 'quote (cons 'do forms)) (list 'list (list 'quote `symbol-macrolet) param-map (list 'quote (cons 'do forms)))) would do the trick. Not sure what to do to handle forms with side effects. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---