Well, it seems that Common Lisp has already solved that problem.
How? Conforming implementations come with a free crate of aspirin?
They have namespaces (called "packages" in Lisp terminology) that take
care of this problem for you.
So this is absolutely not a headache.
Nothing is if you're on the right drugs when it happens.
Hmmm. Â Classpath. Â Lisp doesn't have classpaths. Â Of course, you do have
the headache of making sure that even code containing such a call, even
if it never executes, won't compile. Â So you can't do early testing of
partial implementations.
You can if you comment out the not-yet-reachable bits that refer to
the not-yet-written bits.
And if you want to defend Java, I wouldn't get started on library
dependencies. Â I've experienced software combinations where one had to
have multiple versions of a particular library available, and in exactly
the right order in the classpath so that the code would run.
Sounds like what you'll even more easily get with Lisp. Order
dependency among various (deffoo bar baz quux) lines and therefore
files full of such lines. Name clashes. Multiple implementations or
versions of something. Probably, no language can completely avoid such
issues though.
But again, this isn't really a problem in Lisp. Â I don't know why you
think it would be.
Maybe because it is inevitable?
 The language just works differently.
Yeah. Keep on saying that. Maybe wishes DO come true.
It's one thing if you have
instanceOfSomeUnfamiliarClass.foo() and obviously need a library
installed, but when code calls non-existent methods on standard
library classes like String, who you gonna call? A google search for
"SomeUnfamiliarClass" might turn up the needed library; a google
search for "String" isn't likely to help much.
[raw flamage]
Ah, and now we get to the crux of the matter: not static vs. dynamic
typing or Lisp vs. Java, but man against man, keyboard clashing
against keyboard. En garde!
In CLOS, objects just encapsulate data. Â Period.
Let's set the wayback machine to 1967 shall we, when the shortcomings
of keeping all the data in structs or similar entities, and all the
behavior elsewhere, were becoming painfully apparent as ever-larger
systems were developed, with attendant scaling problems and growing
pains. Then, Ole-Johan Dahl and Kristen Nygaard said "Let there by
classes!" and there was Simula 67...
Lispers are a very interesting clan, it seems. Their main development
tool is a thirty-year-old terminal-mode text editor. Their notion of
an object system appears of an era with peaceniks and Woodstock and "I
Have A Dream". I have to wonder what's in their medicine cabinets, and
whether much of it is legal.
Now for the wakeup call.
The year is now 2009. The seeds planted by Martin Luther's speech took
root decades ago, and we now have an honest-to-god black President
sitting in the Oval Office. Marijuana is still illegal. There's still
a war going badly of dubious morality and motive, but it's not in
Vietnam, it's in Iraq. We have these nifty things called graphics
cards and IDEs now, and the economy is imploding, with climatological
catastrophe looming on the horizon.
I bet to those of you still living in the sixties and seventies, the
above sounds like an opening narration at the start of a bad science-
fiction movie or something, but it's actually real, believe it or
not...
Methods DO NOT BELONG TO CLASSES. Â Instead they are organized base on
the function they perform. Â Each such "generic function" is a particular
operation. Â Methods are added to the generic function to handle
particular argument types (via dynamic multiple dispatch). Â So the
methods really belong to the generic function.
Adding methods might be a problem then, if the generic function you
need to edit is in library code you don't control.
And if no such generic function is defined, your lisp compiler will
complain about it.
What? Surely not -- surely it blithely compiles your code, then your
program chokes on some sort of "message not understood" run-time
exception.
Being able to create generic functions that work with objects created by
others (say in some library code you are using) is a nice way to add
functionality that the library authors didn't anticipate.
I'm more concerned with being able to create objects that work with
generic functions created by others. The English language has seven
times as many nouns as it does verbs, and my own experience suggests
that it's much more common to want to add new objects than to add new
methods to a software system, likewise.
Suppose one manufactured hammers in the manner of an object model where
methods belonged directly to classes. Â In that case, there would be a
set of operations anticipated by the library designer for these new
hammer objects. Â Typical operations would involve things like driving
nails and pulling them out. Â Very functional.
Now, suppose we are laying out a picnic blanket on a windy day. Â We
might decide that we would like to use a hammer to help hold it down.
But we can't do that with an ordinary hammer, because it doesn't have a
method for anchoring a blanket. Â We could only do that if we created our
own specialized hammer-that-can-anchor-blankets subclass, or else if we
put the hammer inside a special anchoring-objects bag first. Â The plain,
ordinary hammer can't fulfill this new purpose, because it wasn't
anticipated.
Software systems are very different. You would not try to make a
construction tool function as a weight or similarly; indeed it's hard
to even make the analogy. The need for a hammer above stems from
lacking a dedicated purpose weight optimized for that task, and a
desire not to drive all the way to the hardware store, or home, or
whatever, and back to get one. In a software system, no such
considerations apply: if you need some simple thing like that you can
typically build it or download it without driving anywhere.
And without access to the source code, you can't change this.
You've just made an argument in favor of open source, not one in favor
of Lisp over Java.
Now the real irony in this discussion is that often the most outrageous
claims are made about Lisp, based on ignorance of the basics of the
language design and philosophy.
That's funny, because it seems the most outrageous claims are being
made about Java, based on ignorance. Not only was mention made of
Java's supposed lack of any dynamic features (and of course
reflection, classloaders, the compiler API, and generic containers
were promptly pointed out by Java partisans) but even of its supposed
slowness. Java hasn't been slow for donkey's years, and people like
you are part of why it is having such a hard time living down its no-
longer-deserved bad reputation in that area.
 On the other hand, almost all of the Lisp programmers are a lot more
familiar and often do program in other languages like Java.
You wouldn't think so, to hear the howlers some of them have written
about Java here lately. I think one even insinuated that it wasn't
even Turing-complete?
I suppose one could adopt the view that the Common Lisp advocates have
somehow had their brains warped by the experience, and inexplicably
cling to the view that Common Lisp is nicer to use for many things. Â But
perhaps a more rational view is that those people most familiar with
both languages prefer Lisp. Â Those people who don't really know anything
about Lisp are the ones that don't like it. Â So what unifying theory
could explain such facts. Â I wonder.
What unifying theory would also explain that the majority of practical
desktop and server applications are not written in Lisp? Desktop apps
are mainly written in C, C++, Delphi, and Pascal, with a smattering of
Java; server applications tend to have a C++ core and quite a lot of
Java, along with glue scripts in shell, perl, python, and ruby, with a
smattering of Lisp. Lisp (and Fortran) only become reasonably common
when you look at scientific, engineering, and comp.sci research apps.
In any case, there are lots of objections that just display a
fundamental ignorance of the Lisp language.
In any case, there are lots of objections that just display a
fundamental ignorance of the Java language.
 It makes it hard to take the critics seriously when they complain
about perceived problems that JUST DO NOT EXIST in Common Lisp
programming practice.
It makes it hard to take the critics seriously when they complain
about perceived slowness that JUST DOES NOT EXIST in Java programming
practice.
And we'll ignore the delusion that strongly typed languages which
compile are therefore bug-free.
I don't think anybody but you ever employed that particular straw-man.
But nobody can deny that there's a big difference between catching 100
bugs after hours of bug-hunting, dozens of debugging prints, and lots
of poring over stack traces and watched-variable logs, and catching 50
bugs that way and 50 instantly when you click "build" (or even when
you write the separate buggy lines of code!).