From: Peter Seibel
Subject: Three more chapters of Practical Common Lisp available for review
Date: 
Message-ID: <m3vfqfywj7.fsf@javamonkey.com>
[I'm posting this in a few forums; apologies to folks who see this
multiple times.]

Just wanted to let folks know that since I last posted an
announcement, I've moved three more chapters of Practical Common Lisp
into the "officially ready for review" stage. As always, the jumping
off point is:

  <http://www.gigamonkeys.com/book/>

while the three new chapters are at:

  <http://www.gigamonkeys.com/book/syntax-and-semantics.html>
  <http://www.gigamonkeys.com/book/functions.html>
  <http://www.gigamonkeys.com/book/variables.html>

As always, feedback, questions, and flames are all welcome.

-Peter

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

         Lisp is the red pill. -- John Fraser, comp.lang.lisp

From: Justin Dubs
Subject: Re: Three more chapters of Practical Common Lisp available for review
Date: 
Message-ID: <2e262238.0310240646.6758999f@posting.google.com>
Peter Seibel <·····@javamonkey.com> wrote in message news:<··············@javamonkey.com>...
> [I'm posting this in a few forums; apologies to folks who see this
> multiple times.]
> 
> Just wanted to let folks know that since I last posted an
> announcement, I've moved three more chapters of Practical Common Lisp
> into the "officially ready for review" stage. As always, the jumping
> off point is:
> 
>   <http://www.gigamonkeys.com/book/>
> 
> while the three new chapters are at:
> 
>   <http://www.gigamonkeys.com/book/syntax-and-semantics.html>
>   <http://www.gigamonkeys.com/book/functions.html>
>   <http://www.gigamonkeys.com/book/variables.html>
> 
> As always, feedback, questions, and flames are all welcome.

Great job Peter.  The book looks wonderful.  The style is great.  I
think a good practical book is what Lisp really needs.

One thing I noticed in the Syntax and Semantics chapter:

"Names used in Lisp programs, such as FORMAT and hello-world, and *db*
are all formed following the same syntactic rule, regardless of what
kind of thing they name.2 Almost any character can appear in a name.
Whitespace characters can not because the elements of lists are
separated by whitespace. And ten characters that serve other syntactic
purposes can't: open and close parenthesis; double, and single quote;
backtick; comma; colon; semicolon; backslash; and vertical bar."

It's not true that you can't include whitespace in symbol names.  You
can include nearly any character in symbol names using the || syntax.

cl-user(0): (setf my-symbol '|sym: with, 'spaces'|)
|sym: with, 'spaces'|
cl-user(1): (set my-symbol 3)
3
cl-user(2): |sym: with, 'spaces'|
3
cl-user(3): (symbol-name my-symbol)
"sym: with, 'spaces'"

Anyway, great work.

Justin Dubs
From: Peter Seibel
Subject: Re: Three more chapters of Practical Common Lisp available for review
Date: 
Message-ID: <m3oew6y48i.fsf@javamonkey.com>
······@eos.ncsu.edu (Justin Dubs) writes:

> Peter Seibel <·····@javamonkey.com> wrote in message news:<··············@javamonkey.com>...
> > [I'm posting this in a few forums; apologies to folks who see this
> > multiple times.]
> > 
> > Just wanted to let folks know that since I last posted an
> > announcement, I've moved three more chapters of Practical Common Lisp
> > into the "officially ready for review" stage. As always, the jumping
> > off point is:
> > 
> >   <http://www.gigamonkeys.com/book/>
> > 
> > while the three new chapters are at:
> > 
> >   <http://www.gigamonkeys.com/book/syntax-and-semantics.html>
> >   <http://www.gigamonkeys.com/book/functions.html>
> >   <http://www.gigamonkeys.com/book/variables.html>
> > 
> > As always, feedback, questions, and flames are all welcome.
> 
> Great job Peter.  The book looks wonderful.  The style is great.  I
> think a good practical book is what Lisp really needs.

Thanks!

> One thing I noticed in the Syntax and Semantics chapter:
> 
> "Names used in Lisp programs, such as FORMAT and hello-world, and *db*
> are all formed following the same syntactic rule, regardless of what
> kind of thing they name.2 Almost any character can appear in a name.
> Whitespace characters can not because the elements of lists are
> separated by whitespace. And ten characters that serve other syntactic
> purposes can't: open and close parenthesis; double, and single quote;
> backtick; comma; colon; semicolon; backslash; and vertical bar."
> 
> It's not true that you can't include whitespace in symbol names.  You
> can include nearly any character in symbol names using the || syntax.

Yup. I actually alluded to that in footnote 3.

-Peter

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

         Lisp is the red pill. -- John Fraser, comp.lang.lisp
From: ······@us.ibm.com
Subject: Re: Three more chapters of Practical Common Lisp available for review
Date: 
Message-ID: <bnbtam$ekm$1@ausnews.austin.ibm.com>
Peter,

For some reason when I read it through the first time I took "even those 
characters" from the footnote to mean the "ten characters that serve other 
syntactic purposes" but not "whitespace" from the previous sentence.  So, 
mostly I just wanted to point out that whitespace WAS allowable, but you 
clearly already know this.  :-)

This is likely just me reading the footnote way to carefully.  I think any 
sane person would have gotten out of it what you wanted them too.

But, my other point remains valid: this IS a cool book.  :-)

Best of luck to you.

Justin Dubs
From: Peter Seibel
Subject: Re: Three more chapters of Practical Common Lisp available for review
Date: 
Message-ID: <m33cdiwf5q.fsf@javamonkey.com>
······@us.ibm.com writes:

> Peter,
> 
> For some reason when I read it through the first time I took "even
> those characters" from the footnote to mean the "ten characters that
> serve other syntactic purposes" but not "whitespace" from the
> previous sentence. So, mostly I just wanted to point out that
> whitespace WAS allowable, but you clearly already know this. :-)
> 
> This is likely just me reading the footnote way to carefully. I
> think any sane person would have gotten out of it what you wanted
> them too.

Not at all--I noticed that potential ambiguity when I went back to the
footnote. I'll see if I can make it more clear.

> But, my other point remains valid: this IS a cool book.  :-)

Thanks.

-Peter

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

         Lisp is the red pill. -- John Fraser, comp.lang.lisp
From: Yarden Katz
Subject: Re: Three more chapters of Practical Common Lisp available for review
Date: 
Message-ID: <86vfqd6uto.fsf@umd.edu>
Peter Seibel <·····@javamonkey.com> writes:

> ······@us.ibm.com writes:
>> But, my other point remains valid: this IS a cool book.  :-)
>
> Thanks.
>
> -Peter

I am anxiously waiting for the chapter on "WebServices."  Since
Allegro has now released their SOAP framework, will your examples use
that or is it going to be a homegrown type of thing?

Thanks,
-- 
Yarden Katz <······@umd.edu>  |  Mind the gap
From: Yarden Katz
Subject: Re: Three more chapters of Practical Common Lisp available for review
Date: 
Message-ID: <86r8116ur8.fsf@umd.edu>
Yarden Katz <······@umd.edu> writes:

> I am anxiously waiting for the chapter on "WebServices."  Since
> Allegro has now released their SOAP framework, will your examples use
> that or is it going to be a homegrown type of thing?

Er, since Franz has no released their SOAP framework.. was what I
meant to say. 
-- 
Yarden Katz <······@umd.edu>  |  Mind the gap
From: Peter Seibel
Subject: Re: Three more chapters of Practical Common Lisp available for review
Date: 
Message-ID: <m3n0bptdai.fsf@javamonkey.com>
Yarden Katz <······@umd.edu> writes:

> Yarden Katz <······@umd.edu> writes:
> 
> > I am anxiously waiting for the chapter on "WebServices."  Since
> > Allegro has now released their SOAP framework, will your examples use
> > that or is it going to be a homegrown type of thing?
> 
> Er, since Franz has no released their SOAP framework.. was what I
> meant to say. 

Hmmm. Actually the web services chapter is a bit on the bubble at the
moment--whether it actually gets written probably depends on the
availability of libraries from Franz or elsewhere and also how long
writing the other parts take. (I have a theory that Lisp should have
some real advantages for dealing with web services since so much of
web services programming seems to be about generating mounds and
mounds of code from XML and XML from code; stuff that might be handled
fairly easily with a few well-placed macros, etc. But that's mostly a
theory at this point and I may run out of room in the margins to
include the proof.)

-Peter

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

         Lisp is the red pill. -- John Fraser, comp.lang.lisp
From: Roman Belenov
Subject: Re: Three more chapters of Practical Common Lisp available for review
Date: 
Message-ID: <u1xt3j7w7.fsf@intel.com>
Peter Seibel <·····@javamonkey.com> writes:

>   <http://www.gigamonkeys.com/book/variables.html>

1. IMHO defconstant and +foo+ naming convention must be mentioned in
   the chapter about variables.

2. You didn't mention local dynamic variables either. In this case I'm
   not sure whether they deserve a paragraph in the main text or just
   a footnote. I used them to have some common bindings between
   several tightly-coupled functions (one "top-level" and several
   others called from it), but, looking at the code again, I see that
   lexical binding spanning definitions of this family of functions
   would work as well (binding helper functions by flet or using
   anonymous lambdas would work too, but main function becomes too
   large and less readable this way). There would be a difference if
   top-level function was recursive (and new bindings were required
   for each recursive call), but I'm not sure that this case is
   practical (too little Lisp experience ;); actually I'd like to see
   other's comments on local dynamic variables - are they used in
   practise ? Or "considered harmful" ? Or <something else> ?

-- 
 							With regards, Roman.

Standard disclaimer: I work for them, but I don't speak for them.
From: Matthew Danish
Subject: Re: Three more chapters of Practical Common Lisp available for review
Date: 
Message-ID: <20031024194641.GZ1454@mapcar.org>
On Fri, Oct 24, 2003 at 01:35:04PM +0400, Roman Belenov wrote:
>    There would be a difference if top-level function was recursive
>    (and new bindings were required for each recursive call), but I'm
>    not sure that this case is practical (too little Lisp experience
>    ;); actually I'd like to see other's comments on local dynamic
>    variables - are they used in practise ? Or "considered harmful" ?
>    Or <something else> ?

Actually, you pointed out precisely why you might want to use them.
Also, consider behavior with threads.  Lexicals used by a number of
functions cause those functions to become non-reentrant, much like
function-static variables in C (see example 1).  In example 2, it is
okay, but much messier and harder to debug.  Local specials that are
bound for each invocation of the entry function are usually handled
properly (though this is not defined in the spec).

example 1

(let (var1 var2)
  (defun foo () ...) 
  (defun bar () ...))

example 2

(defun entry (var1 var2)
  (flet ((foo () ...)
         (bar () ...))
    ;; so long as new threads that call local functions are not spawned 
    ;; in here, or the variables are not mutated
    ...))

-- 
; Matthew Danish <·······@andrew.cmu.edu>
; OpenPGP public key: C24B6010 on keyring.debian.org
; Signed or encrypted mail welcome.
; "There is no dark side of the moon really; matter of fact, it's all dark."
From: Roman Belenov
Subject: Re: Three more chapters of Practical Common Lisp available for review
Date: 
Message-ID: <uu15vhy6j.fsf@intel.com>
Matthew Danish <·······@andrew.cmu.edu> writes:

> Actually, you pointed out precisely why you might want to use them.
> Also, consider behavior with threads.  Lexicals used by a number of
> functions cause those functions to become non-reentrant, much like
> function-static variables in C (see example 1).  In example 2, it is
> okay, but much messier and harder to debug.  Local specials that are
> bound for each invocation of the entry function are usually handled
> properly (though this is not defined in the spec).

-- examples skipped --

Thanks, now I have better confidence in this area.

-- 
 							With regards, Roman.

Standard disclaimer: I work for them, but I don't speak for them.