Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Oh boy.

Name: Anonymous 2010-04-29 0:22


(setf prog '((hax my anix) (dich snake) (LAIN)))
(pprint (third prog))

Name: 6 2010-04-29 14:12

I'm not touching the problem of prog not having earmuff's if it is a special variable.
Why I don't put asterisks on special variables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Several people have asked me to clarify why I don't use the
*earmuff* convention for special variables, so here goes.

First of all, I'm not convinced that unexpected collisions
are unconditionally bad. The way I look at it, you always
learn something when you encounter a collision and you
never learn anything when you don't.

My instinct tells me that the earmuff convention is
dangerous, or at least that it isn't nearly as open-shut
an issue as everyone seems to think. For example, what
sort of binding is this?

(let (*hello*)
  ...)

It is a lexical binding because I haven't declared *hello*
to be special yet. But that's not what you thought when
you first looked at it, was it?

Or consider this: If you are dogmatic about the earmuffs,
why stop there? How about a print-name convention for
distinguishing between macros and functions? Instead of
with-open-file, we could call it ^with-open-file^ so that
we wouldn't need to remember that it is a macro instead of
a function. This convention would also reduce collisions
like accidentally trying to funcall a macro.

Would you use this convention? No, of course you wouldn't.
It's stupid. Instead of relying on a semantically meaningless
print-name convention, it is a better idea to just name
your macros and functions appropriately in the first place.

I consider both of these facts features:

* Invoking a function looks the same as invoking a macro.
* Binding a special variable looks the same as binding
  a lexical variable (with or without earmuffs).

Hope this helps clarify my reasoning,

Doug Hoyte
Strategic Lead API Designer, HCSW

PS. Come to think of it, not even the standard is dogmatic
about the earmuffs. There are at least 6 special variables
defined by ANSI that don't begin and end with asterisks.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List