[cl-faq] Question Genre
John Deszyck
mnemonicsloth at gmail.com
Sat Jan 28 15:18:46 CST 2006
Hi all -
I was checking up on the FAQ posted on lispniks.com, and I a minor
dedndrite-rearranging experience. Specifically, I noticed the
question about FLET, and wondered whether it wouldn't be better
phrased as "when do you use FLET and when do you use LABELS?"
And then I got to thinking that there are a whole lot of these
"situational* sets" of functions in Common Lisp, so it might be useful
to have a reference -- a big table, maybe -- listing the various
reasons to use similar but distinct idioms.
If this idea fleshes out well, it would probably also be a good fit in
the CL Cookbook (note - I haven't finished reading the thread about
that on the main Gardeners list), since some of its answers will be
stylistic rather than behavioral (like the FLET question). Even if
this information does go into the CLCB though, I think it also ought
to be presented in the FAQ. As I develop familiarity with the
language and start wondering about these fine points, I find that the
CL-FAQ is the place where I want to look for answers -- and the urge
to RTFF is so strong that I feel it even though I know the FAQ is 10
years out of date.
Examples I could come up with:
Sequence vs. List vs. Vector vs. Multiple Values
Vector vs. Simple Vector vs. Array
The thousand and one manifestations of LET
The hundred and one manifestations of MAP* ("mapstar" ?)
functions vs. macros vs special forms
write a utility fn or a utility macro
apply vs. funcall
destructive vs. nondestructive
currying & composing
Suggestions for others?
-jd
As a funny aside, I took a perl class when I was a sophomore that was
taught entirely in terms of this kind of distinction -- I remember
answering the same question on ++a/a++ on every quiz. I was never
impressed with perl's conceptual elegance, but I did get reasonably
competent reasonably quickly. My teacher later told me that "x is
like y except that z" is the ancestor class of all human
understanding.
More information about the cl-faq
mailing list