Subject: Re: Packages
From: Erik Naggum <erik@naggum.net>
Date: Tue, 19 Mar 2002 22:14:02 GMT
Newsgroups: comp.lang.lisp
Message-ID: <3225564854303090@naggum.net>

* Drew McDermott
| I don't use the property list, value cell, or function cell of either
| symbol, so what I'd really like to say is, "Treat these as the same
| symbol; they will never occur in the same context, so there will never be
| any ambiguity about which is meant."  Obviously, this example is
| contrived, but this sort of thing has happened to me more than once.

  So use import.

| There seems to be no reason in the world to have to write
| 
| (loop pkg1:for thing in things
|    when (get thing 'color)
|    pkg1:collect thing)
| 
| and
| 
| (wait pkg2:for (event e ...)
|   then pkg2:collect  e)
| 
| but that's what I have to do.

  I cannot fathom how you can do something that produces a problem and
  think that it is somebody else's fault that it does.

  Please note that loop does _not_ use symbols for identity, it uses
  symbols for names.  for, in, when, collect, etc, are compared by
  symbol-name, not eq.

| (In the actual example above, 'for' and 'collect' happen to be in the
| "CL" package, so the problem, by happenstance, wouldn't arise; I just
| chose 'loop' so I could use a familiar macro.)

  Wrong.  for and collect are most definitely _not_ in the common-lisp
  package.  This is so goddamn easy to check.  Why did you just go on your
  assumption?

| For these and other reasons, over the years my Common Lisp style has
| evolved away from being "symbol-dependent."  Whenever possible, I make
| sure my macros use local syntax markers from the keyword package only.  I
| always use tables instead of property lists.  I often define variant
| symbol types that print something like symbols, and when appropriate read
| something like symbols, but differ from symbols in various ways (such as
| not being interned until after the first time they are printed).

  It appears you have based most of this on a subtle confusion.

  It is becoming increasingly clear to me how damaging it is to learn
  Scheme first for a (future) Common Lisp programmer.  There are so many
  subtle differences that are unable to produce strong enough hints to a
  Scheme programmer that he continues to believe the Scheme mindset.  A
  Common Lisp programmer will, on the other hand, get strong enough hints
  that Scheme is different that he cannot use his Common Lisp mindset in
  Scheme.  This leads Scheme people to believe that Common Lisp is just
  like Scheme, and Common Lisp people to _know_ that Scheme is a very
  different language.  Moreover, Scheme people do not understand what the
  Common Lisp people are talking about until they have actually experienced
  the differences, and most of them write Scheme in Common Lisp, anyway, so
  they never do.  Trying to write Common Lisp in Scheme fails miserably.

| On balance I think I would prefer a module system to the package system,
| but it's not a strong preference.

  But they are orthogonal features!  Please try to understand this.

| And now apparently I have to tack on some verbiage about how I love
| "symbol-processing languages," and I despise Scheme (which, believe it or
| not, I do, pretty much), and I'm competent to talk about all this because
| I once coauthored a book on Lisp programming.  Really, the tone on this
| newsgroup often sounds like a meeting of a Communist Party cell circa
| 1935, with the main item on the agenda being how to detect the
| Trotskyites among us.

  Well, gee, you sure help on the attitude.  A newsgroup is what you make
  it.  If you believe you can be a critical outsider _and_ post to the
  newsgroup you criticize without becoming part of it, you are seriously
  deluded.  Lots of people somehow think that there is a "they" concept of
  which they are not a part and that it is useful to distinguish between
  "they" and the critic.  This is a _fantastically_ ludicrous position to
  take.  If you post, you are by definition part of the forum, and if you
  post another hostile message, you are by definition part of problem.
  This _stupid_ attitude that you can somehow walk into a forum and shout
  that other people should not shout without actually shouting, yourself,
  is such a tremendous barrier to peace and progress.  If you have to make
  some remark about other people's "tone" in a hostile tone of your own, at
  least have the honesty and presence of mind to accept responsibility for
  making the situation worse, and by implication _preferring_ the hostile
  tone instead of trying to calm it down.  As an aside: meta-comments like
  that are always hostile because they by their very nature sets up a
  distinction between the poster and everybody else, the poster somehow
  being in the moral clear while everybody else is at fault.  Hypocrisy is
  not a feature of civil discussions.

  Please realize that your emotional response has led you astray: It is not
  a requirement to say that Scheme sucks, it is generally just a whole lot
  smarter _not_ to say that Common Lisp sucks.  This is not a hate group
  for Scheme just because Scheme lovers who also keep denigrating Common
  Lisp are asked to leave.  That is such a bogus causality chain that there
  can be very little credibility in other things you have concluded with
  the same intellectual sloppiness.  Then again, this is precisely the lack
  of observational skills that cause people to believe Common Lisp and
  Scheme are so much alike: they stop looking _completely_ when they are
  satisfied that they have seen "enough", and then they only talk as if the
  world would never have invalidated whatever they were satisfied seeing if
  they had continued to look.  This is not a good way to cope with a world
  in constant flux, and even a world you continously see more of is better
  with your eyes open.

///
-- 
  In a fight against something, the fight has value, victory has none.
  In a fight for something, the fight is a loss, victory merely relief.