What would be an example of an anaphoric conditional in Lisp? Please explain the code as well.
Tell me more
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
|
An example is the Common Lisp LOOP:
The variable IT has the value of the test expression. This is a feature of the ANSI Common Lisp LOOP facility. Example:
returns
because only "SIN" is a name for an existing symbol, here the symbol SIN. In Common Lisp symbol names have internally uppercase names by default. |
|||||||||
|
Paul Graham's On Lisp has a chapter on Anaphoric Macros. Essentially, it's a shorthand way of writing statements that avoids repeating code. For example, compare:
and
where |
|||||||||||||
|