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

  • Re: More questions about exported symbols and general style.
    ... packages that I'll be using. ... This is a bit of a tangent, but: don't write anaphoric macros. ... names magically spring into existence without visible bindings is not ...
    (comp.lang.lisp)
  • Re: More questions about exported symbols and general style.
    ... up bindings to captured variables (like IT in anaphoric macros) in ... packages that I'll be using. ... names magically spring into existence without visible bindings is not ...
    (comp.lang.lisp)
  • More questions about exported symbols and general style.
    ... up bindings to captured variables (like IT in anaphoric macros) in ... packages that I'll be using. ... I've found I've gotten in the habit of naming captured variables ...
    (comp.lang.lisp)
  • Re: Scheme macros
    ... global bindings for later reuse. ... local bindings or see changes from other places you essentially need ... by associating the information with uninterned symbols, ... Of course, the details will be hairy, so one eventually needs macros ...
    (comp.lang.lisp)
  • Re: More questions about exported symbols and general style.
    ... This is a bit of a tangent, but: don't write anaphoric macros. ... names magically spring into existence without visible bindings is not ... but "magically springing into existence without visible bindings" is not one of them. ... you have to use define-symbol-macro and symbol-macrolet to bring symbol macros into existence. ...
    (comp.lang.lisp)