Re: More questions about exported symbols and general style.
- From: "Pillsy" <pillsbury@xxxxxxxxx>
- Date: 27 Dec 2006 11:13:01 -0800
Bill Atkins wrote:
"Pillsy" <pillsbury@xxxxxxxxx> writes:
I have considered this argument. I almost never use AIF, ACOND and the
like, but I do have various function-creating macros inspired by /On
Lisp/, like
(fn (+ $1 $2)) => (lambda ($1 $2) (+ $1 $2))
Ewww.
I had no idea people would hate that so much. I guess I know now why I
don't see more of it. :^)
Anonymous and even nonymous functions in other languages often work
this way. It was a pretty conscious imitation of what I like about
Mathematica's anonymous function syntax.
Upside: yes. Downside: they *have* to do that choosing, and since most
of my reliance on anaphora and such is in macros that make anonymous
functions, having visually weird magical bindings makes it easy to see
at a glance which variables are being closed over.
Personally, I prefer macros that bind to explicit variables:
(when-let (message (read-next-message *the-connection*))
(format t "~&Got message: ~S" message))
You can define a whole suite of these: IF-LET, COND-LET, etc. (or
BWHEN, BLET, BCOND). They aren't much longer than their A*
equivalents and you get to avoid all the sticky side effects of using
anaphoric macros.
I do like that better than the AIF, et c., so I may well *yoink* it for
myself. Still, it's tough to resist the terseness for anonymous
function declaration....
Cheers,
Pillsy
.
- Follow-Ups:
- Re: More questions about exported symbols and general style.
- From: Bill Atkins
- Re: More questions about exported symbols and general style.
- References:
- More questions about exported symbols and general style.
- From: Pillsy
- Re: More questions about exported symbols and general style.
- From: Zach Beane
- Re: More questions about exported symbols and general style.
- From: Pillsy
- Re: More questions about exported symbols and general style.
- From: Bill Atkins
- More questions about exported symbols and general style.
- Prev by Date: Re: More questions about exported symbols and general style.
- Next by Date: Re: What about these?
- Previous by thread: Re: More questions about exported symbols and general style.
- Next by thread: Re: More questions about exported symbols and general style.
- Index(es):
Relevant Pages
|
|