Prev: member and defparameter
Next: Common Lisp for Mac OS X
From: Rob Warnock on 27 May 2010 21:05 Pascal J. Bourguignon <pjb(a)informatimago.com> wrote: +--------------- | Scott Graham <scott.cll(a)h4ck3r.net> writes: | > ... I had made it harder for myself by attempting to rename | > the symbol that the 'go' was jumping to. That seems to make it | > necessary to understand the structure of "everything" to be able to | > find the go's. | > | > If I just walk the top level though, it isn't too complex. | | Notice that in the top level macro, you can use macrolet and | flet/labels to provide operators to the inferior lexical levels as | deep as needed. +--------------- Note that this is a fairly common idiom in CL macrology. E.g., the main macro in the HTML-generating HTOUT & CL-WHO is WITH-HTML-OUTPUT, which defines a whole bunch of helper macrolets -- HTM, FMT, LFD, ESC, & STR -- which capture/reference bits of the lexical environment set up by WITH-HTML-OUTPUT (well, really only the output stream variable, but it *could* have been more) to provide useful abbreviations within the body of the main macro. Similarly, "collecting" macros define macrolets for various collection operators [see EXT:COLLECT in CMUCL]. -Rob ----- Rob Warnock <rpw3(a)rpw3.org> 627 26th Avenue <URL:http://rpw3.org/> San Mateo, CA 94403 (650)572-2607 |