Re: More questions about exported symbols and general style.



Zach Beane wrote:

"Pillsy" <pillsbury@xxxxxxxxx> writes:

Well, two questions about exporting symbols, really. Say I want to set
up bindings to captured variables (like IT in anaphoric macros) in
packages that I'll be using. Do I want to just export IT and friends,
or should I walk through the code and replace them with gensyms or
something?

This is a bit of a tangent, but: don't write anaphoric macros. Making
names magically spring into existence without visible bindings is not
very Lispy.

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))

that I find more expressive (as well as more concise) than more
explicit alternatives. Besides, adding not-so-Lispy bits to Lisp is
pretty Lispy, what with FORMAT and LOOP. :^D

When bindings are explicit, you don't have to worry about exporting
IT; the user can just use a symbol of their choosing. Plus, it nests properly.

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.

Cheers,
Pillsy

.



Relevant Pages