Subject: Re: SBCL is now faster than Java, as fast as Ocaml, and getting better
From: rpw3@rpw3.org (Rob Warnock)
Date: Thu, 17 Jul 2008 21:02:27 -0500
Newsgroups: comp.lang.lisp
Message-ID: <hqSdnU3KE8MuZOLVnZ2dnUVZ_vGdnZ2d@speakeasy.net>
Vassil Nikolov  <vnikolov+usenet@pobox.com> wrote:
+---------------
| Kenny <kentilton@gmail.com> said:
| | Rob Warnock wrote:
| | | And it is precisely this lack of "enslavement" which motivated
| | | CL to *silently ignore* excess return values and provide NIL
| | | for excess caller requests for them, whereas the Scheme standards
| | | [and most Scheme implementations] blow chunks at any caller/callee
| | | mismatch on number of values.
...
| | Oh, man. What part of...
| | | Liberty vs. safety. No brainer! I pick liberty!
| | ...do academics not understand?
| 
| Before this is accepted as the only possible verdict and sentence is
| passed, consider that this is in fact just one possible point in
| language design space...
+---------------

Of course. But that's not to say that all points in design space
will be judged as "equally good" by all users.

+---------------
| Common Lisp chooses to consider multiple values as representing data
| points that are related, but each with a meaning on its own, so it
| allows an arbitrary subset of them to be silently discarded.
| Another principle, I believe also reasonable... [reordering a bit --rpw3]
| ...might be that multiple values are considered to form a single
| compound value, and thus it would be justified for the language
| processor to insist that they are all received.
+---------------

Reasonable, perhaps, if one were of that persuasion. And if one were,
then having the language processor enforce it would also be reasonable.

But not all users *will* find it reasonable, since not all users are
of that persuasion[1] or perhaps not of that persuasion all the time.
[See below for the design option of *selective* enforcement.]

+---------------
| ...and not impinging on anyone's freedom...
+---------------

Free choice is fine; forced choice is not so fine. One may freely
choose to use Scheme, for example, but once one has done so then
the choice of whether values-matching is enforced by the language
processor is no longer a choice, and thus *does* impinge on one's
freedom.

Whereas if one freely chooses to use Common Lisp, then one has the
*choice* of whether to enforce such values matching. One can easily
write one's own MULTIPLE-VALUE-BIND/STRICT which would raise a condition
if the binding list and the values delivered did not exactly match, e.g.:

    (multiple-value-bind/strict (a b c)
	(values 1 2 3 4)
      (list a b c))
    >> Error: Function returned more values than available binding variables!
    >>  To continue, type :CONTINUE followed by an option number:
    >>   1: Return to Lisp Toplevel.
    >>  Debug> 

It might not be as *efficient* as the built-in MULTIPLE-VALUE-BIND, but
it's at least possible to write. The language gives one such freedom.

It's *that* choice [in *addition* to the default convenience of
relaxed values-matching] that is the significant "liberty" of CL!!


-Rob

[1] I myself, however, am [now, 2008] of the other persuasion,
    which is partially why I switched [circa 2000] from Scheme to CL.

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607