> There has gone much thought, and philosophical analysis, into nearly > all of the features you'll find in the current ANSI CL spec, and I > expect the same to happen with any other new ingredient that might > be added to that self-same standard in the future... So before we > added some kind of (mandatory) compile-time type-checking to Lisp, > I'd want to be very sure that we are doing the right thing here
If you read the discussion in this thread carefully you will find that not everybody, and certainly not me, was asking for a language change. The suggestion was for implementations to make use of the type information that can already be specified using existing language features. I am referring here to types specified using the declare form, type specifiers of slots, argument types in generic functions, and perhaps other things I can't think of at the moment.
Especially in the CLOS area, where the language already requires a lot more type checking than in other parts of CL, I find the behaviour of the commercial implementation I'm using rather puzzling. Take this example:
(defclass foo () ()) (defgeneric bla ((self foo) (num integer))) (defmethod bla ((self foo) arg2 arg3))
The last call raises an error because the method bla doesn't conform to the generic function's signature. Good.
But when I do this:
(defun bob () (bla (make-instance 'foo) 1 2))
which includes an incorrect call to the same generic function there is no error and no warning. The environment clearly has the information to warn me about this error here and now, but it doesn't. Instead, I or the QA department get an exception when (bob) is called at runtime.
So, I'm not asking for any deep change in Lisp, the language, just some early warnings from the implementation's compiler about my frequent blunders :-(
> Well, and C++/Java-style "type-checking" strikes me as being most > obviously not the right thing.
Well, there is room for improvement, but I wouldn't discount it as harshly as you do.
> you'd want something like the current crop of typed pure functional > languages, like Haskell or OPAL, etc.,
You may want to add Cecil and Idea to this list.
> That would be the course of action for C++ programmers that *really* > cared about compile-time type-checking.
C++ has changed a lot over time because the community was not afraid to learn from others. If this tradition continues you can expect the result of research on these languages to make its way into C++ at some point. In contrast, the Lisp community, if this newsgroup is any indication, seems to totally discount the value of static typing. This can mean a number of things, of course, including the possibility that I'm totally off-base. :-)
> The sayings "Lisp programmers know the value of everything and the > cost of nothing" vs. "C++ programmers know the cost of everything, > yet the value of nothing" come to mind.
You may also want to consider Guy Steele's statement suggesting that programming language design is an evolutionary process.
> Since I've heard in this discussion that C++-style type-checking is > mostly helpful in uncovering simple mistakes in argument order, etc., > (which strikes me as being as mostly unrelated to type-checking), I'd > suggest using environments that reduce the likelyhood of MAKING those > mistakes. Although I've not been prone to making those mistakes even > in languages like C++, in my Lisp environment, not only have I got the > arglist and documentation of every Lisp operator -- whether built-in or > user-defined -- at my finger-tips, but also the complete Hyperspec, all > just a keypress away. So if I'm only a tiny bit in doubt about > argument order, or semantics, I look them up.
This is a misunderstanding of what I was trying to express by the term 'simple error'. When referring to simple mistakes I am talking precisely about situations when I have absolutely NO DOUBT about what I'm doing, but get it wrong anyway, like forgetting an argument in a call, accidentally passing the wrong variable, etc. etc.
> Of course, a much more "simplistic" kind of type-checking can be > attained with CMU CL today... Not that I see most former C++ users > flocking to CMU CL instead of other CL implementations though...
Others have mentioned CMU CL as well, I'll take a look at this. Unfortunately, it won't help in my current situation where we depend on third-party packages which are not available for CMU CL, not to mention a heavy investment in our own existing code.
* gglea...@unm.edu (Gavin E. Gleason) | CMUCL alows you to specify types, and I imagine that the commercial | compilers do as well. Just because it is not specified in ANSI does not | mean that it does not exist in most implementations... but it would be | nice if it were specified.
could you give some examples of the types that CMUCL allows that are not the ANSI standard?
* Joachim Achtzehnter <joac...@kraut.bc.ca> | In contrast, the Lisp community, if this newsgroup is any indication, | seems to totally discount the value of static typing.
that's funny -- I read it exactly that opposite way. Lispers care about typing, including static type information, and because they care, they know what kind of costs are involved in them relative to the benefits and why the C++ model is so fundamentally braindamaged as to become totally unpalatable and useless. _because_ we value static type information, but also know the costs, we have decided against anal-retentive tools, but would use tools that can utilize such information productively. however, the kinds of mistakes that you seem to think are so important do not in fact occur often enough to be a significant problem, so the value would lie in optimization across function calls. this is dangerous territory in an environment where you can change function definitions dynamically.
>Others have mentioned CMU CL as well, I'll take a look at this. >Unfortunately, it won't help in my current situation where we depend >on third-party packages which are not available for CMU CL, not to >mention a heavy investment in our own existing code.
>Joachim
As far as I could tell by looking at CMUCL documentation, CMUCL is for UNIX only. Is there a Windows version?
jo...@removethisbeforesending.cetasoft.com (Joshua Scholar) writes: > As far as I could tell by looking at CMUCL documentation, CMUCL is for > UNIX only. Is there a Windows version?
Nope. (Someone once mentioned a few of the cmucl-imp people are interested in one.)
then visit franz.com to get the Linux Trial Edition and also grab the Debian CMU CL packages. If you like visual IDEs there is also Harlequin's new Linux Personal Edition.
Erik Naggum <e...@naggum.no> writes: > * gglea...@unm.edu (Gavin E. Gleason) > | CMUCL alows you to specify types, and I imagine that the commercial > | compilers do as well. Just because it is not specified in ANSI does not > | mean that it does not exist in most implementations... but it would be > | nice if it were specified.
> could you give some examples of the types that CMUCL allows that are not > the ANSI standard?
I haven't used CMUCL, but from what I've heard about it, I'm guessing he means it hyperoptimizes what type info you give. My impression is that most compilers don't go to the same intense effort, but could. The cool thing about CMUCL is supposed to be exactly the fact that its many interesting optimizations didn't require language changes to do in a conforming implementation.
> On Wed, 05 May 1999 23:36:48 GMT, please-reply-in-the-fo...@thank.you > wrote:
> >The overwhelmingly > >most common reason is the perception that Lisp is a > >special purpose language for academic projects where > >efficiency doesn't matter. > So I'd think a better question than why people who don't know anything > about modern Lisp systems don't use them would be, what do Lisp > systems need in order to be useful to everyone who does know about > them.
I think its the usual circular reinforcement problem, the reputation of LISP attracts people writing acandemic projects where efficiency doesn't matter, and thus LISP conforms ever more to those people, which increases its reputation in that department.
Of course, efficiency is no longer an issue with LISP, the dynamic comiler technology keeps up well enough with C++ or whatever.
More important issues are things like packaging; many lisp environment do not compile executables, and many of the ones that do still dont provide full functionality of the interpreter for the environment, and so your generated program can lack the features you typically desire from a LISP program, like the ability to dynamically self-modify, or allow the user to type in custom algorithms. This basically means that a lot of useful programs are undeliverable without including the lisp environment itself.
Other places where lisp falls severely short currently is the areas that interest mainstream programmers the most: database access, sockets, threading, IPC, and 3d graphics. None of these interfaces are standardised or even discussed, and while most implementations now have some or all of these facilities, they are not cohesive in their interface, and are sometimes poorly documented and incomplete to boot.
Some LISP implementations still do not interface well with other languages, while "popular" languages (C/C++/Objective-C, Java, Ada, Pascal) generally have a relatively safe way of communiating between languages (although the interface definitions in Ada can be fairly arduous).
LISP's object-oriented paradigm is powerful and yet... It's essentially dynamic operator overloading, which is about as interesting to an object modeller as a stack of bricks. Although this is certainly only an opinion and perhaps a trend, object orientation is centered on message passing, while LISP's object orientation is based on function calls (still). I won't say its not USEFUL, but its not attractive, and its not a step forward unless you are writing "toy" applications.
This is only the beginning of a long list of language weaknesses on LISP. Its important to realise that each language has its own use, and LISP as it stands is great for writing small tests of algorithms before porting them to a real language.
> many lisp environment > do not compile executables, and many of the ones that do still dont > provide full functionality of the interpreter for the environment, and > so your generated program can lack the features you typically desire > from a LISP program, like the ability to dynamically self-modify, or > allow the user to type in custom algorithms. This basically means that > a lot of useful programs are undeliverable without including the lisp > environment itself.
So the reasoning would run "I'd like to use feature X in Lisp, but can't without delivering a whole Lisp system, therefore I'll instead write in a language which lacks X"? Are you /sure/ people think this way? Sounds weird to me.
> Other places where lisp falls severely short currently is the areas that > interest mainstream programmers the most: database access, sockets, > threading, IPC, and 3d graphics. None of these interfaces are > standardised or even discussed, and while most implementations now have > some or all of these facilities, they are not cohesive in their > interface, and are sometimes poorly documented and incomplete to boot.
Compared to, say, ISO C which includes all the things you mention in the standard. No? Well, maybe C++? No? Pascal? Fortran?
> Some LISP implementations still do not interface well with other > languages, while "popular" languages (C/C++/Objective-C, Java, Ada, > Pascal) generally have a relatively safe way of communiating between > languages (although the interface definitions in Ada can be fairly > arduous).
You ever tried passing an Ada function as a Motif callback? Or a Java method? I think you mean "most systems have some limited way of talking to C, and sometimes C will answer".
> LISP's object-oriented paradigm is powerful and yet... It's essentially > dynamic operator overloading, which is about as interesting to an object > modeller as a stack of bricks. Although this is certainly only an > opinion and perhaps a trend, object orientation is centered on message > passing, while LISP's object orientation is based on function calls > (still). I won't say its not USEFUL, but its not attractive, and its > not a step forward unless you are writing "toy" applications.
If you carefully restrict yourself to dispatching only on a single parameter, the only difference I can see is that the verb comes before the first argument, rather than after. Is this /really/ enough to demolish your "object modeller"'s world view?
Ian Wild <i...@cfmu.eurocontrol.be> writes: > > Some LISP implementations still do not interface well with other > > languages, while "popular" languages (C/C++/Objective-C, Java, Ada, > > Pascal) generally have a relatively safe way of communiating between > > languages (although the interface definitions in Ada can be fairly > > arduous).
> You ever tried passing an Ada function as a Motif callback? > Or a Java method? I think you mean "most systems have some > limited way of talking to C, and sometimes C will answer".
JNI is not for the faint of heart.
> > LISP's object-oriented paradigm is powerful and yet... It's essentially > > dynamic operator overloading, which is about as interesting to an object > > modeller as a stack of bricks. Although this is certainly only an > > opinion and perhaps a trend, object orientation is centered on message > > passing, while LISP's object orientation is based on function calls > > (still). I won't say its not USEFUL, but its not attractive, and its > > not a step forward unless you are writing "toy" applications.
> If you carefully restrict yourself to dispatching only on a single > parameter, the only difference I can see is that the verb comes before > the first argument, rather than after. Is this /really/ enough to > demolish your "object modeller"'s world view?
I might be very stupid. But I am doing the following.
I have a hierachy of classes where I implement some manipulation methods.
Then I have a separate hierarchy which implements some operation to be dispatched in terms of the first one.
I can't escape doing the following
class Clazz { type_t do_something(A a); type_t do_something(B b); type_t do_something(C c); type_t do_something(D d); ... // You get the idea... // Suppose you also have A -> B -> C-> D -> as your hierarchy.
void do_something_appropriate(A a) { do_something(a); }
}
Now, suppose you have code like
{ Clazz clazz = new Clazz(); B myB = new B();
clazz.do_something_appropriate(myB);
}
This is Java like. In C++ you have extra messiness due to 'virtual' and pointer/references.
Now, what do you expect gets printed?
In Common Lisp it is exactly what you'd expect.
Cheers
-- Marco Antoniotti =========================================== PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY tel. +39 - 06 68 10 03 17, fax. +39 - 06 68 80 79 26 http://www.parades.rm.cnr.it/~marcoxa
Marco Antoniotti <marc...@copernico.parades.rm.cnr.it> writes: > Ian Wild <i...@cfmu.eurocontrol.be> writes:
> > > LISP's object-oriented paradigm is powerful and yet... It's essentially > > > dynamic operator overloading, which is about as interesting to an object > > > modeller as a stack of bricks. Although this is certainly only an > > > opinion and perhaps a trend, object orientation is centered on message > > > passing, while LISP's object orientation is based on function calls > > > (still). I won't say its not USEFUL, but its not attractive, and its > > > not a step forward unless you are writing "toy" applications.
.... > { > Clazz clazz = new Clazz(); > B myB = new B();
> clazz.do_something_appropriate(myB); > }
> This is Java like. In C++ you have extra messiness due to 'virtual' > and pointer/references.
> Now, what do you expect gets printed?
> In Common Lisp it is exactly what you'd expect.
Allow me to continue.
You claim that CLOS style object orientation is only for 'toy' systems.
If you went along with my example and did some extra playing around, you will have noticed that you soon introduce a lot of "tag" statements (which, AFAIK Java supports much better that C++) in order to achieve your goals. You can always claim that I designed my hierarchies in a poor way, but that is begging the question.
(defmethod do-somethin-approriate ((c clazz) (an-a a)) (do-something c an-a))
end of story.
Now go ahead, extrapolate and maintain this and the C++ or Java versions. Better yet, add a new class to the a->b->c hierarchy. What would you have to do, had you written the beast in C/C++? What do you have to do if it was written in CL?
Cheers
-- Marco Antoniotti =========================================== PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY tel. +39 - 06 68 10 03 17, fax. +39 - 06 68 80 79 26 http://www.parades.rm.cnr.it/~marcoxa
> > > > LISP's object-oriented paradigm is powerful and yet... It's essentially > > > > dynamic operator overloading, which is about as interesting to an object > > > > modeller as a stack of bricks. Although this is certainly only an > > > > opinion and perhaps a trend, object orientation is centered on message > > > > passing, while LISP's object orientation is based on function calls > > > > (still). I won't say its not USEFUL, but its not attractive, and its > > > > not a step forward unless you are writing "toy" applications.
Calumny!
I /responded/ to the above by suggesting that carefully avoiding interesting CLOS features allows you to emulate the "attractive" OO style the original author prefers.
The fact that your code needs CLOS features that C++ doesn't have just goes to show you weren't careful enough. :-)
> > > > > LISP's object-oriented paradigm is powerful and yet... It's essentially > > > > > dynamic operator overloading, which is about as interesting to an object > > > > > modeller as a stack of bricks. Although this is certainly only an > > > > > opinion and perhaps a trend, object orientation is centered on message > > > > > passing, while LISP's object orientation is based on function calls > > > > > (still). I won't say its not USEFUL, but its not attractive, and its > > > > > not a step forward unless you are writing "toy" applications.
> Calumny!
> I /responded/ to the above by suggesting that carefully avoiding > interesting CLOS features allows you to emulate the "attractive" > OO style the original author prefers.
OOPS. I jumped a citation level. :{ Sorry
> The fact that your code needs CLOS features that C++ doesn't > have just goes to show you weren't careful enough. :-)
.. in choosing the language I suppose :)
Cheers
-- Marco Antoniotti =========================================== PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY tel. +39 - 06 68 10 03 17, fax. +39 - 06 68 80 79 26 http://www.parades.rm.cnr.it/~marcoxa
* Dobes Vandermeer <do...@mindless.com> [ a _lot_ of ignorant crap deleted ]
in all my years on USENET, I have seen a lot of destructive idiots post their favorite drivel in the guise of facts, and some even manage to look like they have a clue, but I cannot recall anyone quite so destructive or quite so willing to lie and misrepresent as Dobes Vandermeer of the aptly named MINDLESS.COM. _nothing_ he says is true or even relevant to what Lisp can offer today or why this offer is not widely accepted.
Lisp does have a problem: it doesn't come with a big enough stick with which to hit the ignorant fucks so they get out of their retarded state.
> This is not why most people want static type checking. The real big > advantage of static type checking is neither a matter of enabling > compilers to optimize code, nor to prove complete correctness, but to > catch simple errors early. It is the difference between being told by > the compiler that I've made a typo versus the bug blowing up in front > of a user at runtime.
Here's a true story. I was demonstrating a distributed application at a `demo-days' event. It took about 5 minutes to bring the whole application up from scratch.
While doing it for one potential customer, I made a typo that invoked behavior I hadn't handled. The application went into the debugger with a `segmentation violation' error.
Imagine what would have happened if this were a C or C++ program. But this was lisp. I just made a few conciliatory noises and re-invoked the main entry point of the application. Total time: 10 seconds. I'm not even sure the person watching the demo realized it had crashed.
Note that this was a (simple) logic error that static typing would not have caught.
The moral is that lisp is DIFFERENT from other languages, and things you need to give great attention to with other languages are relatively unimportant in lisp.
Unless I'm mistaken, it's already possible to declare everything in lisp. It's also possible to give optimization settings that will warn you about type problems at compile time (at least, CMUCL will do this). You can get run-time checks with appropriate optimization settings, and disable them selectively if you need speed. You can get the best of both styles of programming. So I don't see what the fuss is about.
-- Fred Gilham gil...@csl.sri.com How many Analytic Philosophers does it take to change a light bulb? None---it's a pseudo-problem. Light bulbs give off light (hence the name). If the bulb was broken and wasn't giving off light, it wouldn't be a 'light bulb' now would it? (Oh, where has rigor gone?!)
> LISP's object-oriented paradigm is powerful and yet... It's essentially > dynamic operator overloading, which is about as interesting to an object > modeller as a stack of bricks. Although this is certainly only an > opinion and perhaps a trend, object orientation is centered on message > passing, while LISP's object orientation is based on function calls > (still). I won't say its not USEFUL, but its not attractive, and its > not a step forward unless you are writing "toy" applications.
Sorry, but this doesn't make much sense to me, I must be missing your point. Perhaps you should explain what you mean? CLOS generic functions offer everything that C++ virtual methods, Java methods, Eiffel features, etc. give you. What is it that makes generic functions less useful than their more primitive counterparts in most other OO languages?
Is it multiple dispatch? Well, other languages are envious of this feature, so it can hardly be a disadvantage. Stroustrup himself says in one of his books that multiple dispatch is the one major feature he would have liked to add to C++, if only he had found the time to integrate it without compromising the performance of virtual function calls.
Is it the difference in syntax? This can hardly be responsible for limiting the usefulness to toy applications, and again there are others who recommend to migrate to the more symmetric placement of arguments, e.g. see Chris Date's recent book which proposes a database language along these lines. And in case you haven't noticed: using the STL with C++ methods would have been much less awkward if the target argument of C++ method calls was in the natural place.
And unlike other parts of CL, CLOS even requires a fair amount of static type checking by requiring consistent lambda lists in the methods of a generic function, although some implementations could provide more help with type checking than they do (at least warnings), see my other postings on this subject.
Ian Wild <i...@cfmu.eurocontrol.be> writes: > > Other places where lisp falls severely short currently is the areas that > > interest mainstream programmers the most: database access, sockets, > > threading, IPC, and 3d graphics. None of these interfaces are > > standardised or even discussed, and while most implementations now have > > some or all of these facilities, they are not cohesive in their > > interface, and are sometimes poorly documented and incomplete to boot.
To Joachim: which vendor poorly documents any of these interfaces?
> Compared to, say, ISO C which includes all the things you mention > in the standard. No? Well, maybe C++? No? Pascal? Fortran?
Java. :-) But seriously now, for the ammount of typing time it takes to pound out a decent Java app (typing speed seems to be the main bottleneck with Java programming), you could have written it in Lisp _and_ read the documentation to three different Lisp vendor's products so that you could write your thin portable abstraction layer to all their non-standard functionality that you're _actually_ using, not just imagining that you'll have some need for the portability and then using Java to write an app that you only get arround to distributing for Windows-only customers anyways.
> To Joachim: which vendor poorly documents any of these interfaces?
That should be Dobes Vandermeer, not Joachim. Apologies to Joachim. I'd cancel the article and post a corrected one, but it's probably already too late (3 minutes). That'll teach me to rush in the morning before class....
Fred Gilham <gil...@snapdragon.csl.sri.com> writes:
> Unless I'm mistaken, it's already possible to declare everything in > lisp.
Yes, I have pointed this out a few times already. I am not asking for a language change, only for implementations to make USE of this information to warn me about problems earlier rather than later.
> It's also possible to give optimization settings that will warn > you about type problems at compile time (at least, CMUCL will do > this).
CMUCL indeed provides a lot of the warnings I am looking for, I played with it last night. Too bad that the commercial implementation I'm stuck with for now doesn't! :-(
> You can get run-time checks with appropriate optimization > settings, and disable them selectively if you need speed. You can get > the best of both styles of programming. So I don't see what the fuss > is about.
Well, as you can see we are not so far apart after all. :-) These 'appropriate optimization settings' are all I want.
And the really good thing is that one doesn't have to change the implementation to do that (if one wants that syntax): the _user_ can do their own version of DEFUN which expands the above into something like:
(I am neither for nor against such syntax, at the time of this writing; just want to show it can be done without the need for a new compiler for the new syntax.)
-- Vassil Nikolov <vniko...@poboxes.com> www.poboxes.com/vnikolov (You may want to cc your posting to me if I _have_ to see it.) LEGEMANVALEMFVTVTVM (Ancient Roman programmers' adage.)
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Joachim Achtzehnter <joac...@kraut.bc.ca> writes: > (defclass foo () ()) > (defgeneric bla ((self foo) (num integer))) > (defmethod bla ((self foo) arg2 arg3))
> The last call raises an error because the method bla doesn't conform > to the generic function's signature. Good.
> But when I do this:
> (defun bob () (bla (make-instance 'foo) 1 2))
> which includes an incorrect call to the same generic function there is > no error and no warning. The environment clearly has the information > to warn me about this error here and now, but it doesn't. Instead, I > or the QA department get an exception when (bob) is called at runtime.
What's really puzzling about this particular behavior is (at least in Allegro Common Lisp and Macintosh Common Lisp) that in the following example with non-generic functions, the compiler does produce a warning:
USER> (defun foo (x y) (+ x y)) FOO USER> (compile 'foo) FOO NIL NIL USER> (defun bar (x y z) (foo x y z)) BAR USER> (compile 'bar) ; While compiling BAR: Warning: FOO should be given exactly 2 arguments. It was given 3 arguments. Problem detected when processing (FOO X Y ...) inside (BLOCK BAR (FOO X Y ...)) inside (PROGN (BLOCK BAR (FOO X Y ...)))
BAR T T
----------------------------------------
Is there something about generic functions that makes it harder to do the same sort of argument count analysis?
-- Thomas A. Russ, USC/Information Sciences Institute t...@isi.edu
Joachim Achtzehnter <joac...@kraut.bc.ca> writes: > Fred Gilham <gil...@snapdragon.csl.sri.com> writes:
> > Unless I'm mistaken, it's already possible to declare everything in > > lisp.
> Yes, I have pointed this out a few times already. I am not asking for a > language change, only for implementations to make USE of this > information to warn me about problems earlier rather than later.
Right. But it is long-established that the newsgroup is not a good place to report bugs in individual implementations. And you're basically saying that this is an implementation bug. The right place to report implementation deficiencies is to your vendor, not to the world.
Vassil Nikolov <vniko...@poboxes.com> writes: > In article <m3so9cgjlq....@shodan.demon.co.uk>, > Paul Rudin <pa...@shodan.demon.co.uk> wrote: > > Kent M Pitman <pit...@world.std.com> writes:
> > > Nothing in CL forbids you from type-declaring every variable.
> > It might be nice to have some standard, succinct syntax for this. > > Maybe something like:
For this to be valid surely the standard would need to be modified?
I agree that your example is more in keeping with the style of CL and therefore probably better. I was, however deliberately vague about exactly what the syntax given should be equivalent to. There are a number of things that might be desirbale, and you might what different syntaxes (is that the plural form of syntax?) for these and combinations thereof.
> And the really good thing is that one doesn't have to change > the implementation to do that (if one wants that syntax): the > _user_ can do their own version of DEFUN which expands the above > into something like:
Yes, picking your own syntax is fine up to a point, but other code may have used the same syntax for a differnt purposes and you then run into problems if you want to combine your code with such.
> * Dobes Vandermeer <do...@mindless.com> > [ a _lot_ of ignorant crap deleted ]
> in all my years on USENET, I have seen a lot of destructive idiots post > their favorite drivel in the guise of facts, and some even manage to look > like they have a clue, but I cannot recall anyone quite so destructive or > quite so willing to lie and misrepresent as Dobes Vandermeer of the aptly > named MINDLESS.COM. _nothing_ he says is true or even relevant to what > Lisp can offer today or why this offer is not widely accepted.
> Lisp does have a problem: it doesn't come with a big enough stick with > which to hit the ignorant fucks so they get out of their retarded state.
>>>> In message <7gvbjb$mt...@nnrp1.deja.com> >>>> On the subject of "Re: Newbie questions [Followup to comp.lang.lisp]" >>>> Sent on Fri, 07 May 1999 18:32:11 GMT >>>> Honorable Vassil Nikolov <vniko...@poboxes.com> writes:
>> >> I don't think we need a new standard for that. The DEFMETHOD >> syntax: ``(parameter class)'' can be reused, so that the above >> example becomes: >> >> (defun (foo integer) ((lyst cons) (x integer) ...) >> ...)
what about optional arguments with default values?
-- Sam Steingold (http://www.goems.com/~sds) running RedHat6.0 GNU/Linux Micros**t is not the answer. Micros**t is a question, and the answer is Linux, (http://www.linux.org) the choice of the GNU (http://www.gnu.org) generation. Trespassers will be shot. Survivors will be prosecuted.
> > LISP's object-oriented paradigm is powerful and yet... It's essentially > > dynamic operator overloading, which is about as interesting to an object > > modeller as a stack of bricks. Although this is certainly only an > > opinion and perhaps a trend, object orientation is centered on message > > passing, while LISP's object orientation is based on function calls > > (still). I won't say its not USEFUL, but its not attractive, and its > > not a step forward unless you are writing "toy" applications.
> Sorry, but this doesn't make much sense to me, I must be missing your > point. Perhaps you should explain what you mean? CLOS generic > functions offer everything that C++ virtual methods, Java methods, > Eiffel features, etc. give you. What is it that makes generic > functions less useful than their more primitive counterparts in most > other OO languages?
CLOS provides a world view where we have extended functions to overload based on the class of its operators. The object abstraction of data and methods has been lost; CLOS methods are not methods, but functions, and CLOS does not protect encapsulated data from the "outside world" of functions and methods.
A "better" object world view would allow for only acessing fields in the object directly inside of methods for the object, thus providing the mystical "encapsulation" that is currently underpromoted in CLOS. I hesitate to say that CLOS does not allow you to think in this way, yet I will assert that typical examples I have encountered make no effort to do so.
The syntax, although it is often trivialized by many people, is also fairly important. In a LISP function call, all arguments are weighted equally, and so you are led to think about specialising based on any or all of the parameters. And object-oriented version, i.e. "(send-msg-to obj (do-something a b c d))" shows you which object is being operated upon, and although you could (easily) still specialize on the remaining variables (i.e. a b c and d) to call a different method, the message-passing paradigm is preserved.