[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Date: 06 Apr 87 1334 PDT
From: Dick Gabriel <RPG at SAIL.STANFORD.EDU>
I was under the impression that people on this list were not required
to explain why they thought something was in bad taste nor provide
alternatives. Jonathan wrote recently:
``I would strongly oppose the Common Lisp multiple value semantics. I
find it to be very distasteful.''
There was no further discussion of reasons or alternatives.
No one asked... if you care to know, it's because I think ignored
values, as well optional arguments for that matter, are a form of
overloading, and overloading is a kind of pun, and punning is to be
avoided where possible, since (in my opinion) it's likely to lead to
code that's buggy and/or unreadable and/or not well thought out.
Sometimes overloading is just what you want in order for your code to be
modular, but I haven't observed that in these situations. This is all
very vague, of course, which is why I waved my hands.
(LAMBDA (X Y Z . R) ...)
puts a lot semantic emphasis on the character `.'. It relies on a joke
involving the (coincidental) underling data structure that is sometimes
used to represent expressions.
I agree, this is a feature of dubious design. This probably ought to be
written (LAMBDA ARGS (... something which takes apart ARGS ...)).
Perhaps the n-ary version of LAMBDA ought to have a different name.
The line that starts
is simply a recovery from the language design error reflected on the
I think that if we (may I be so bold?) are considering a richer
parameter-passing language, we should carefully consider and decide what
information we wish to have expressed regarding how variables will be
bound upon function entry. Possibly we want to define a language for
passing structures of various types which will then be decomposed and bound
upon function entry - this would be much like alien structure languages
in some languages.
The advantage of Common Lisp &-markers is that it is relatively clear that
something funny is going on, and a programmer doesn't have to rely on a
human reader to always see the tiny `.'.
I know of no instance where someone has failed to see the dot, or where
someone has been confused about its basic meaning... a bigger problem with
it than its small size is the fact that you can't write
(LAMBDA (. R) ...)
(which, by the way, is legal in T, and it does what you'd expect). &REST,
#!REST, &DOT, |.|, etc., it is true, do not suffer from this problem.
If the strategy is to be able to pass an arbitrary number of arguments,
then a syntax that binds one variable to all of them following by a
pretty destructuring bind of some sort is much better than a
syntax that mixes required with &rest (as Jonathan suggested).
I agree. In my experience, pattern-matching languages seem to have an
inevitable tendency to become baroque and disgusting. But let's not
stop looking for a decent one.
Thanks for explaining.