From: Martin Pomije
Subject: Style question: #\  versus #\Space
Date: 
Message-ID: <90ac4ec2.0311141400.462390c1@posting.google.com>
In "ANSI Common Lisp" Paul Graham uses #\  for the space character.  A
good example of this is on p. 65.

(defun second-word (str)
  (let ((p1 (+ (position #\  str) 1)))
    (subseq str p1 (position #\  str :start p1))))

Or in Fig. 4.2, p. 67

(defun constituent (c)
  (and (graphic-char-p c)
       (not (char= c #\  ))))

I came across #\Space while reading through the Hyperspec (thanks
Kent) and find it to be much easier to read.  However, Paul Graham's
experience makes me wonder if there isn't something that I'm missing.

Which one do you prefer?

From: Thomas F. Burdick
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <xcvn0aya64y.fsf@fallingrocks.OCF.Berkeley.EDU>
······@MartinPomije.eiomail.com (Martin Pomije) writes:

> In "ANSI Common Lisp" Paul Graham uses #\  for the space character.  A
> good example of this is on p. 65.

Unfortunately, I don't think Paul Graham is a very good source for
micro-style in Common Lisp.  For style-in-the-large, yes, but he's
quite clear that although he loves Lisp, he has little love for the
specific design decisions of Common Lisp.  This means that in some
ways, his style fights against the language.  Keep going through the
book, for sure, just if you find yourself thinking, "that looks a
little too concise, almost cryptically so," it probably is.

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Darius
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <20031114183408.00000915.ddarius@hotpop.com>
On 14 Nov 2003 15:21:17 -0800
···@fallingrocks.OCF.Berkeley.EDU (Thomas F. Burdick) wrote:

> ······@MartinPomije.eiomail.com (Martin Pomije) writes:
> 
> > In "ANSI Common Lisp" Paul Graham uses #\  for the space character. 
> > A good example of this is on p. 65.
> 
> Unfortunately, I don't think Paul Graham is a very good source for
> micro-style in Common Lisp.  For style-in-the-large, yes, but he's
> quite clear that although he loves Lisp, he has little love for the
> specific design decisions of Common Lisp.  This means that in some
> ways, his style fights against the language.  Keep going through the
> book, for sure, just 

if you find yourself thinking, "that looks a
> little too concise, almost cryptically so," it probably is.

When is that advice -not- true?
From: Rob Warnock
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <0MqdnZ-4W-CJdyuiXTWc-g@speakeasy.net>
Thomas F. Burdick <···@fallingrocks.OCF.Berkeley.EDU> wrote:
+---------------
| ······@MartinPomije.eiomail.com (Martin Pomije) writes:
| > In "ANSI Common Lisp" Paul Graham uses #\  for the space character...
...
| ...if you find yourself thinking, "that looks a little too concise,
| almost cryptically so," it probably is.
+---------------

Here's my ultimate example of excessively cryptic (and dangerous) style:

	> (defmacro \  (args &body body)
	    `(lambda ,args ,@body))
	| |
	>

Now you can write all kinds of concise[1] anonynmous functions:

	> (mapcar (\  (x) (* x 3)) '(1 2 3))
	(3 6 9)
	> (position 4 '(5 6 7 8) :test (\  (x y) (= x (- y 3))))
	2
	> 

;-}  ;-}


-Rob

[1] Well, just remember to type *two* spaces after the backslash...

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Pascal Bourguignon
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <87he14etn9.fsf@thalassa.informatimago.com>
····@rpw3.org (Rob Warnock) writes:

> Thomas F. Burdick <···@fallingrocks.OCF.Berkeley.EDU> wrote:
> +---------------
> | ······@MartinPomije.eiomail.com (Martin Pomije) writes:
> | > In "ANSI Common Lisp" Paul Graham uses #\  for the space character...
> ...
> | ...if you find yourself thinking, "that looks a little too concise,
> | almost cryptically so," it probably is.
> +---------------
> 
> Here's my ultimate example of excessively cryptic (and dangerous) style:
> 
> 	> (defmacro \  (args &body body)
> 	    `(lambda ,args ,@body))
> [1] Well, just remember to type *two* spaces after the backslash...

Actually only one is needed, because ( is a terminating macro char.
http://www.lisp.org/HyperSpec/Body/sec_2-1-4.html

[2]> (defun a(a)'a)
A
[9]> (defmacro \ (args &body body)`(lambda ,args ,@body))
| |
[13]> (funcall(\ (a b)(+ a b))1 2)
3
[14]> 


-- 
__Pascal_Bourguignon__
http://www.informatimago.com/
From: Kent M Pitman
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <sfwhe1487d7.fsf@shell01.TheWorld.com>
····@rpw3.org (Rob Warnock) writes:

> Thomas F. Burdick <···@fallingrocks.OCF.Berkeley.EDU> wrote:
> +---------------
> | ······@MartinPomije.eiomail.com (Martin Pomije) writes:
> | > In "ANSI Common Lisp" Paul Graham uses #\  for the space character...
> ...
> | ...if you find yourself thinking, "that looks a little too concise,
> | almost cryptically so," it probably is.
> +---------------
> 
> Here's my ultimate example of excessively cryptic (and dangerous) style:
> 
> 	> (defmacro \  (args &body body)
> 	    `(lambda ,args ,@body))
> 	| |
> 	>
> 
> Now you can write all kinds of concise[1] anonynmous functions:
> 
> 	> (mapcar (\  (x) (* x 3)) '(1 2 3))
> 	(3 6 9)
> 	> (position 4 '(5 6 7 8) :test (\  (x y) (= x (- y 3))))
> 	2
> 	> 
> 
> ;-}  ;-}

It's perhaps of historical interest that in Maclisp we used / for what
CL uses \ for.  That means to divide you had to use //.  One of the
most common things was to get a bug report from a newbie to Maclisp
saying that something like | 5| or | X| was an undefined operator, and
asking what was that error message all about.

A few moment's thought may lead you to figure out why we eventually
went with backslash as the syntactic quoting character like most other
languages did.
From: Kalle Olavi Niemitalo
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <87ptfs2zdh.fsf@Astalo.kon.iki.fi>
····@rpw3.org (Rob Warnock) writes:

> [1] Well, just remember to type *two* spaces after the backslash...

One space is enough; the open-parenthesis is a terminating macro character.
From: Tayss
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <5627c6fa.0311142142.3834df79@posting.google.com>
······@MartinPomije.eiomail.com (Martin Pomije) wrote in message news:<····························@posting.google.com>...
> I came across #\Space while reading through the Hyperspec (thanks
> Kent) and find it to be much easier to read.  However, Paul Graham's
> experience makes me wonder if there isn't something that I'm missing.
> 
> Which one do you prefer?

If you want a book ref, Guy Steele's cltl2 i/o chapter mentions that
the name is to be preferred with nonprinting characters.  (And he
claims #\Space is more stylish than #\space. ;)  It hasn't worn off
that I still think it's pretty cool to name characters... and it gives
rise to that pun where people walk around with their first names in
their sigs like:
#\Tayssir
From: Peter Seibel
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <m3ekwalifp.fsf@javamonkey.com>
······@MartinPomije.eiomail.com (Martin Pomije) writes:

> In "ANSI Common Lisp" Paul Graham uses #\  for the space character.  A
> good example of this is on p. 65.
> 
> (defun second-word (str)
>   (let ((p1 (+ (position #\  str) 1)))
>     (subseq str p1 (position #\  str :start p1))))
> 
> Or in Fig. 4.2, p. 67
> 
> (defun constituent (c)
>   (and (graphic-char-p c)
>        (not (char= c #\  ))))
> 
> I came across #\Space while reading through the Hyperspec (thanks
> Kent) and find it to be much easier to read.  However, Paul Graham's
> experience makes me wonder if there isn't something that I'm missing.
> 
> Which one do you prefer?

#\Space

-Peter

-- 
Peter Seibel                                      ·····@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp
From: Barry Margolin
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <sRctb.511$lK3.247@news.level3.com>
In article <··············@javamonkey.com>,
Peter Seibel  <·····@javamonkey.com> wrote:
>······@MartinPomije.eiomail.com (Martin Pomije) writes:
>
>> In "ANSI Common Lisp" Paul Graham uses #\  for the space character.  A
>> good example of this is on p. 65.
>> 
>> (defun second-word (str)
>>   (let ((p1 (+ (position #\  str) 1)))
>>     (subseq str p1 (position #\  str :start p1))))
>> 
>> Or in Fig. 4.2, p. 67
>> 
>> (defun constituent (c)
>>   (and (graphic-char-p c)
>>        (not (char= c #\  ))))
>> 
>> I came across #\Space while reading through the Hyperspec (thanks
>> Kent) and find it to be much easier to read.  However, Paul Graham's
>> experience makes me wonder if there isn't something that I'm missing.
>> 
>> Which one do you prefer?
>
>#\Space

Me too.  It's more readable, and much less likely to be ruined accidentally
by editing.

-- 
Barry Margolin, ··············@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Christopher C. Stacy
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <uwua28sq3.fsf@dtpq.com>
>>>>> On Fri, 14 Nov 2003 22:40:24 GMT, Barry Margolin ("Barry") writes:

 Barry> In article <··············@javamonkey.com>,
 Barry> Peter Seibel  <·····@javamonkey.com> wrote:
 >> ······@MartinPomije.eiomail.com (Martin Pomije) writes:
 >> 
 >>> In "ANSI Common Lisp" Paul Graham uses #\  for the space character.  A
 >>> good example of this is on p. 65.
 >>> 
 >>> (defun second-word (str)
 >>> (let ((p1 (+ (position #\  str) 1)))
 >>> (subseq str p1 (position #\  str :start p1))))
 >>> 
 >>> Or in Fig. 4.2, p. 67
 >>> 
 >>> (defun constituent (c)
 >>> (and (graphic-char-p c)
 >>> (not (char= c #\  ))))
 >>> 
 >>> I came across #\Space while reading through the Hyperspec (thanks
 >>> Kent) and find it to be much easier to read.  However, Paul Graham's
 >>> experience makes me wonder if there isn't something that I'm missing.
 >>> 
 >>> Which one do you prefer?
 >> 
 >> #\Space

 Barry> Me too.  It's more readable, and much less likely to be ruined
 Barry> accidentally by editing.

I've been programming in Lisp forever, and didn't even realize that
you could do #\ in CL!  (And I wouldn't want to ever see it.)
From: Thomas F. Burdick
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <xcv7k225ny2.fsf@famine.OCF.Berkeley.EDU>
······@dtpq.com (Christopher C. Stacy) writes:

> I've been programming in Lisp forever, and didn't even realize that
> you could do #\ in CL!  (And I wouldn't want to ever see it.)

Not only can you do #\ in CL, but even #\	, in which case you might
not see it, depending on the column it starts in.

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Kenny Tilton
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <rdgtb.95471$ri.14571241@twister.nyc.rr.com>
Christopher C. Stacy wrote:

> I've been programming in Lisp forever, and didn't even realize that
> you could do #\ in CL!  (And I wouldn't want to ever see it.)
> 

Yeah, but now we can claim white space is significant and win over all 
the Pythonistas.

:)

-- 
http://tilton-technology.com

Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

Your Project Here! http://alu.cliki.net/Industry%20Application
From: Pascal Bourguignon
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <87brrewfhk.fsf@thalassa.informatimago.com>
······@MartinPomije.eiomail.com (Martin Pomije) writes:

> In "ANSI Common Lisp" Paul Graham uses #\  for the space character.  A
> good example of this is on p. 65.
> 
> (defun second-word (str)
>   (let ((p1 (+ (position #\  str) 1)))
>     (subseq str p1 (position #\  str :start p1))))
> 
> Or in Fig. 4.2, p. 67
> 
> (defun constituent (c)
>   (and (graphic-char-p c)
>        (not (char= c #\  ))))
> 
> I came across #\Space while reading through the Hyperspec (thanks
> Kent) and find it to be much easier to read.  However, Paul Graham's
> experience makes me wonder if there isn't something that I'm missing.
> 
> Which one do you prefer?

Neither. I use (character " ").


-- 
__Pascal_Bourguignon__
http://www.informatimago.com/
From: Alexander Schreiber
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <slrnbrcpi3.rgn.als@thangorodrim.de>
Martin Pomije <······@MartinPomije.eiomail.com> wrote:
>In "ANSI Common Lisp" Paul Graham uses #\  for the space character.  A
>good example of this is on p. 65.
>
>I came across #\Space while reading through the Hyperspec (thanks
>Kent) and find it to be much easier to read.  However, Paul Graham's
>experience makes me wonder if there isn't something that I'm missing.
>
>Which one do you prefer?

I prefer #\Space because it makes its purpose clear: "Thou shalt make
thy program's purpose and structure clear to thy fellow man [..], 
for thy creativity is better used in solving problems than in creating 
beautiful new impediments to understanding."[0]

Regards,
       Alex.
[0] Shamelessly stolen from Henry Spencers "Ten Commandments for C
    Programmers"
-- 
"Opportunity is missed by most people because it is dressed in overalls and
 looks like work."                                      -- Thomas A. Edison
From: Duane Rettig
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <44qx2zz66.fsf@franz.com>
···@usenet.thangorodrim.de (Alexander Schreiber) writes:

> Martin Pomije <······@MartinPomije.eiomail.com> wrote:
> >In "ANSI Common Lisp" Paul Graham uses #\  for the space character.  A
> >good example of this is on p. 65.
> >
> >I came across #\Space while reading through the Hyperspec (thanks
> >Kent) and find it to be much easier to read.  However, Paul Graham's
> >experience makes me wonder if there isn't something that I'm missing.
> >
> >Which one do you prefer?
> 
> I prefer #\Space because it makes its purpose clear: "Thou shalt make
> thy program's purpose and structure clear to thy fellow man [..], 
> for thy creativity is better used in solving problems than in creating 
> beautiful new impediments to understanding."[0]

Another reason to prefer #\Space is because that is what the lisp tends
to print out.  This is, of course, a style question only, and there is
really no one answer, but often, when I am not sure how I should arrange
my code, I either let my editor or my lisp break the tie by stating its
opinion.

-- 
Duane Rettig    ·····@franz.com    Franz Inc.  http://www.franz.com/
555 12th St., Suite 1450               http://www.555citycenter.com/
Oakland, Ca. 94607        Phone: (510) 452-2000; Fax: (510) 452-0182   
From: vsync
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <87vfpkheuq.fsf@piro.quadium.net>
······@MartinPomije.eiomail.com (Martin Pomije) writes:

> I came across #\Space while reading through the Hyperspec (thanks
> Kent) and find it to be much easier to read.  However, Paul Graham's
> experience makes me wonder if there isn't something that I'm missing.
> 
> Which one do you prefer?

I use #\Space because '#\ ' seems to mess up ILISP's parser sometimes.

-- 
vsync
http://quadium.net/
Banking on my hopes that whoever grades this will just look at the
pictures, I drew an exponential through my noise. I believe the
apparent legitimacy is enhanced by the fact that I used a complicated
computer program to make the fit.
	-- http://www.cs.wisc.edu/~kovar/hall.html
From: Tyro
Subject: Re: Style question: #\  versus #\Space
Date: 
Message-ID: <ff11f622.0311170633.171b81c8@posting.google.com>
At the moment I am studying Paul Graham's book in which he uses #\ .
However, I disagree with Graham on this matter and replace his #\ 
with #\Space. In my code I use #\Space because it is clear.