Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!news.duke.edu!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!ix.netcom.com!netcom.com!alderson
From: alderson@netcom.com (Richard M. Alderson III)
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: <aldersonCyEAyM.5H3@netcom.com>
Reply-To: alderson@netcom.com
Fcc: /u52/alderson/postings
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: Fri, 28 Oct 1994 18:20:45 GMT
Lines: 49

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)!

Both of these posts have mistaken "code vs. data" for "dual namespaces vs.
single namespace."  The two concepts are unrelated.

One the issue of code and data having the same representation, tell me whether
the following is code or data:

	(foo 1 2 seven :bar)

Without the context of a complete Lisp program, you can't say, and even then it
may be questionable.  (Suppose the program in question is a compiler?)

The issue of 1 namespace for function names and variable names, or 2, is
exemplified as follows:

	(defun factorial (n)
		(if (< n 2) 1
		    (factorial (- n 1))))

	(let ((factorial 11))
	     (factorial factorial))

In any dual-namespace Lisp, Common or not, the _let_ form will evaluate
correctly to a numeric value.  In a single-namespace Lisp, it will barf when
the value 11 is plugged into the function slot.

(Both s-exprs, though, are perfectly valid data.... ;-)
-- 
Rich Alderson   You know the sort of thing that you can find in any dictionary
                of a strange language, and which so excites the amateur philo-
                logists, itching to derive one tongue from another that they
                know better: a word that is nearly the same in form and meaning
                as the corresponding word in English, or Latin, or Hebrew, or
                what not.
                                                --J. R. R. Tolkien,
alderson@netcom.com                               _The Notion Club Papers_
