Subject: Re: Packages
From: Erik Naggum <erik@naggum.net>
Date: Sun, 17 Mar 2002 00:00:55 GMT
Newsgroups: comp.lang.lisp
Message-ID: <3225312066723120@naggum.net>

* Erann Gat
| A mentor of mine at the time (1988 or so) once expounded on the virtues
| of environments and the evils of packages.  He made an offhand comment
| that I still remember to this day: "Common Lisp" he said "really has a
| flat namespace."  What he meant was that there was little effective
| difference between packages as they exist in CL, and a Lisp with only one
| package and a reader hack that attached the prefix "package:" (where
| "package" is replaced with the value of the global variable *package*) to
| all symbol names that didn't already have colons in them before interning
| them.

  I begin to see where you come from and where you went wrong, Erann.  This
  is such a stupid thing to say that I marvel at the respect you must have
  felt for this mentor.  I hope _I_ shall never have a student who does not
  have in him the ability to say "that's a load of crap, Erik" if I make a
  similarly retarded point and expect people to believe it, not laugh.

  How about the function and variable values of a symbol?  It is just as if
  we had used Scheme evaluation rules, but had a reader hack that prefixed
  the first position of a form with "operator-" and every other symbol with
  "variable-".  See?  No material difference between Scheme and Common Lisp
  -- they are equivelant modulo a reader hack.  Right?  If you see how
  _retarded_ it would be to explain the difference this way, which I
  suspect you will, since I am not your highly respected mentor and you are
  free to think instead of believe, it should help you realize just how
  retarded the explanation that you heard about packages was, too.

| Now, this isn't quite right, of course, because of import, export, and
| use-package, but his fundamental point has stuck with me through the
| years, that discriminating between multiple interpretations of a symbol
| name at read time rather than at eval time was the Wrong Thing.

  This is just too incredible to be for real.  There is no discrimination
  between multiple interpretation of a symbol at read time.  That is just
  _so_ confused, no wonder you have serious problems.  Have you actually
  ever understood Common Lisp at all, Erann?  I have to wonder.  At read
  time, a string is interned in only one package to return a symbol.  There
  _is_ no symbol without the package.  There are only the characters in a
  symbol's name.

  Again and again, you show us that you are _horribly_ confused and that
  much of your dislike of Common Lisp comes not from Common Lisp, but from
  some staggeringly stubborn misconception and refusal to listen to others.

| (This is not to say that I necessarily agree with this point of view,
| just that I remember it.)

  The more I read from you, the more I think you are a Scheme person.
  This is not a compliment.

| Through the years I have always found the package system to be pretty
| annoying.  I often find myself doing the following:
| 
| > foo
| ERROR: foo is unbound         ; Doh!  Forgot that foo is in foo-package
| > (use-package 'foo-package)
| ERROR: symbol FOO-PACKAGE:FOO conflicts with symbol FOO  ; Arrggh!!!

  Such are the results of incompetence at work.  And how typical to react
  emotionally at something so fundamentally silly.  How come I never have
  this problem?  Could it be that I use symbol completion in Emacs?  Could
  it be that when I once in a while do get an _error_ like this, one of the
  available restarts is to unintern the old symbol and proceed, so I have
  no _problem_ with it?  Could it be that I build my packages with care and
  actually want to know which package a symbol is in -- _because_ I do not
  consider packages and symbols evil?

| So I've always considered packages as more of a necessary evil than a
| feature.

  Yop, Scheme is for you, this is becoming clearer and clearer.

| I was told that this view was common in the CL world, as reflected in one
| of Guy Steele's many subtle jokes in CLTLn: in both editions of the book
| the section dealing with packages is "chapter 11", which in the American
| legal system refers to a set of laws dealing with bankruptcy.

  I find this unfunny, not because it is offensive, but because it is so
  stupid.  It could have been a cute pun if it it has been rephrased as
  something like "Common Lisp packages are in Chapter 11", but as stated it
  is just dumb, mostly because "Chapter 11" is nothing more than a silly
  coincidende and it has to be in an expression that relates it to the
  U.S. Bankruptcy Code to make any sense.
  
  But your interpretation of what "Chapter 11" sort of "means" is actually
  a very good example of how _wrong_ it is to do eval-time interpretation
  instead of read-time.  It may make for puns (good, bad, atrocious), but
  not understanding.  Unless one wants to publish books without a Chapter
  11 like some hotels do not have a 13th floor because of a similarly bad
  case of numerology and mysticism, there will have to be a Chapter 11 in
  books with more than 10.  E.g., exceptions are bankrupt in Java in your
  "interpretation" because they are in Chapter 11 in both editions of "The
  Java Language Specification", also written by Steele, et al, so surely
  this is not accidental, either.  I am sure this is "fun" to people who do
  eval-time interpretation with random environments, but I find it _stupid_.
  
  BTW, Chapter 11 of the U.S. Bankruptcy Code (Title, not Chapter, 11 of
  the United States Code) is concerned with reorganization.  It applies
  when your creditors have some hope that they will recover their money if
  they can (forcibly) reorganize the company.  Chapter 7 (liquidation)
  applies when there is no hope and the creditors accept whatever share
  they get from the proceeds of its liquidation.  This should have been
  common knowledge to anyone who has any interest in referring to the
  U.S. legal system.  A remarkable level of intellectual sloppiness is
  necessary to make this connection and to think it has any meaning.

| But in the recent discussion of what "first class symbol" means a number
| of people have made statements that at least imply (and sometimes
| explicitly state) that they like packages, that they think they really
| are a cool feature.

  You know, there are some people who move to other countries, or other
  places in the same country, whatever, and who manage to _like_ the place
  they have moved to, even though it has lots of flaws and problems and
  unlikable people and funny smells and such, probably just like the place
  they moved from, which they probably also made up their mind to like, but
  it may not have worked out, or they wanted something _different_, not for
  lack of like.  Then there are people who know what they will and will not
  like and who are _never_ satisfied or happy with anything, and who are
  more than likely to _avoid_ doing anything than doing something they do
  not like through and through.  Scheme has a history of not doing anything
  because they _feared_ that would not like it, or that somebody had made
  up their mind they did not like it even before they tried.

  I think the ability to make up your mind to like something you _want_ to
  use is kind of crucial to survival.  There is so much wrong with the
  world that one has to accept flaws and imperfections and just get on with
  one's purpose in life.  People who _have_ no purpose, do not need this.
  There is no such thing as a necessary evil.  Thinking in such terms is
  itself destructive, not only to one's ability to do what is necessary,
  but to appreciate the results.  If you have deal with necessary evils all
  the time, you will be in a state of permanent frustration, and what
  better way of expressing this than "I like Common Lisp, but ...", and of
  becoming so frustrated with Common Lisp that one spends one's time
  griping about the language instead of just getting on with one's life.

  But more importantly, the attitude problems that result in one's
  inability to "like" something one has to use or do because of many other
  factors, such as liking _them_, is actually pandemic to a personality.
  People who have to set _all_ the rules, cannot _follow_ any rules.  We
  have seen this in people who publicly favor going behind their clueless
  boss instead of working _with_ him, we have seen this is people who make
  their _living_ from other people's trust that they can follow a standard
  specification go public with statements that it is "braindamaged".
  However, there are people who are actually able to live and prosper in a
  system where respecting authorities, the rule of law, your boss and the
  chain of command, etc -- one does not _have_ to be a criminal to make
  money or become rich, but it helps some, like Bill Gates and Enron and
  such, but by far most criminals end up rather destitute or dead at an
  early age.  Protesting against authority is an immature youth thing, part
  of breaking free from your parents, but some people actually figure out
  that authority itself is not what made it necessary to break with your
  parents, and they do not have to break with every other authority the
  same way.

| For those of you who feel this way I have the following question: were
| you aware of the eval-time alternative for resolving name conflicts
| provided by environments?

  Yes, we call them hashtables using strings for keys.  Oh, right, Scheme
  does not have hashtables.  Common Lisp also supports hashtables that use
  keywords for keys.

| And if you were, what is it that makes you prefer packages?

  This question makes absolutely no sense.  If I am aware of the existence
  of white meat, why do I prefer red meat?  I like both, I eat both, but on
  different occasions.  I use hashtables with string keys for some things
  and keyword for others.  I sometimes use the package system because the
  reader is such a convenient function that I do not want to reimplement
  it, and the package system has some really nifty features that, if you
  can come to like what you have, you can find good use for.

  If you cannot like what you have freely accepted, there is something
  wrong with you.  If you do not accept something, but you cannot break
  free from it, there is something wrong with you.  You have but one life
  to live, and it is too short to remain too long with your mistakes and
  too long _not_ to leave them behind in time.

///
-- 
  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.