Re: Crazy macro
- From: Pascal Bourguignon <pjb@xxxxxxxxxxxxxxxxx>
- Date: Sat, 29 Apr 2006 18:53:01 +0200
"Drew McDermott" <airfoyle@xxxxxxxxxxxxxx> writes:
[...]
So, we need a way to avoid Vietnamization while preserving the fact
that we're reading a single piece of code. Here's where the macro
comes in. It's called 'control-nest.' A call looks like this:
(control-nest
:tag1
exp1[:tag2]
:tag2
exp2[:tag3]
...
:tagN
expN)
(tagbody
:tag1
exp1[(go :tag2)]
:tag2
exp2[(go :tag3)]
...
:tagN
expN)
Did you really need a new macro? What do you win? Avoiding to write (GO )?
Recently on cll, we presented a macro with something more than a mere
tagbody: in addition to the control flow, it links the data flow.
http://groups.google.com/group/comp.lang.lisp/browse_frm/thread/a8c3d95939adc6aa/a712e4d464bb9945?lnk=st&q=functional-pipe+group%3Acomp.lang.lisp+author%3APascal+author%3ABourguignon&rnum=1&hl=en#a712e4d464bb9945
(functional-pipe
(lambda (item) (elementp x (funcall neighborhood item)))
(print :hi)
(remove-if-not ** items)
(mapcar neighborhood *)
(reduce (function intersection) *)))
--
__Pascal Bourguignon__ http://www.informatimago.com/
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we. -- Georges W. Bush
.
- Follow-Ups:
- Re: Crazy macro
- From: Drew McDermott
- Re: Crazy macro
- References:
- Crazy macro
- From: Drew McDermott
- Crazy macro
- Prev by Date: Re: with-slots on instances of structure classes and performance
- Next by Date: Re: Crazy macro
- Previous by thread: Crazy macro
- Next by thread: Re: Crazy macro
- Index(es):