Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!yeshua.marcam.com!usc!howland.reston.ans.net!ix.netcom.com!netcom.com!vrotney
From: vrotney@netcom.com (William Paul Vrotney)
Subject: Re: Common Lisp's dual name space
In-Reply-To: Blake McBride's message of 27 Oct 1994 15:02:00 GMT
Message-ID: <vrotneyCyF4As.39p@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <Pine.A32.3.91.941014091539.42306C-100000@swim5.eng.sematech.org> <Cxxwx0.1nC@rheged.dircon.co.uk> <Cy1H5H.5I8@cogsci.ed.ac.uk> <38icti$132@goanna.cs.rmit.oz.au> <Cy8tty.6E2@rheged.dircon.co.uk> <38ofd8$set@edge.ercnet.com>
Date: Sat, 29 Oct 1994 04:54:28 GMT
Lines: 53

In article <38ofd8$set@edge.ercnet.com> Blake McBride <blake@edge.ercnet.com> writes:

>   > In article <38icti$132@goanna.cs.rmit.oz.au>,
>   > Richard A. O'Keefe <ok@goanna.cs.rmit.oz.au> wrote:
>   > (see papers by eg Gabriel) as shorthand to distinguish those LisPs
>   > (e.g. PSL, Interlisp, Scheme, EuLisp) which have a single namespace
>   > for code and data, and those (e.g. Common LISP) which have separate
>   > function and value namespaces. 
>
>   This dual name space aspect of Common Lisp is my no. 1 complaint
>   of Common Lisp.  Why the heck would someone do such a thing?
>
>   One of the main things which makes Lisp attractive is its ability
>   to allow data and programs to look alike.  The dual name space bit
>   makes taking advantage of this fact very kludgy (syntacticly)!
>

I guess you could view Common Lisp as having two name spaces, one for
functions and one for values, but it's not a good way to think of it.  The
function and value are two different properties of the same symbol whose
print name itself is nothing more than a property of that single symbol.
For example

        (defun faa ...)
        (defvar faa ..)

both use the same store of the symbol represented by FAA but store the
function as one property of FAA and the value as another.  In fact one could
argue that the use of the term "dual name space" is conceptually wrong for
Common Lisp since it is perfectly valid to store a function in the value
space and APPLY it when its name is encountered as the CAR of a syntactic
list.  Also a function or value does not even have to have a name at all!
It would probably be less confusing if for dialects like Scheme the term
"single property space" for function and value were used instead of "single
name space".

Personally, syntactically, I prefer the dual way of Common Lisp since I can
write:

        (let ((check (check a b))) ...)

instead of

        (let ((check1 (check a b))) ...)

But there are other good reasons for doing things this way beyond syntax
which I won't go into here.

If you want to appreciate the name space schemes of any Lisp extant try
using the same name in various ways in a C++ program on different
implementations.
-- 
Bill Vrotney - vrotney@netcom.com
