Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion PART ONE: Lisp & Education: Re: Norvig's latest paper on Lisp
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
James A. Crippen  
View profile  
 More options Jun 20 2002, 2:33 am
Newsgroups: comp.lang.lisp
From: ja...@unlambda.com (James A. Crippen)
Date: 19 Jun 2002 22:33:51 -0800
Local: Thurs, Jun 20 2002 2:33 am
Subject: Re: PART ONE: Lisp & Education: Re: Norvig's latest paper on Lisp
Ed L Cashin <ecas...@uga.edu> writes:

> Maybe his _ANSI Common Lisp_ is what you're looking for.  I can't help
> mentioning that I recently picked up a used copy of Steele's _Common
> Lisp the Language_, 2nd edition, and it's a reference that has helped
> my beginning lisp programming take off.

Although I've never read PG's _ANSI Common Lisp_ I've heard so many
good things about it that I never hesitate to recommend it, which goes
against my not recommending books I've not read personally.

I just learned Lisp straight from CLtL1 and CLtL2.  I started with the
former because that's all the university library had at the time.
When I discovered CLtL2 I saved up my pennies and bought a copy.  I
used it so much the pages started falling out (damned perfect
binding...).

Then I heard about KMP's HyperSpec, which was around the time it first
became available.  Honestly I'd love to have a printed version of the
HyperSpec, but I just can't bring myself to burn that much toner and
paper.  

I thought about getting the official ANSI spec, and bought it in
electronic form (which of course gives you every right to print it, so
I wouldn't feel bad).  It turned out to be the shittiest 150 dpi scan
I'd seen, even worse than the old MIT AI Lab memos, and even worse
than what the USPTO puts out for old patents.  A waste of my money.

> The Hyperspec is great for reference, but it's online documentation --
> sometimes I prefer a book, and it's sometimes a bit sparse for this
> beginner.  CLTL2 gives me enough meat (examples, explanation, etc.)
> for me to thoroughly understand things.

I keep hoping that maybe someday someone will inspire GLS enough to
write a CLtL3.  Or that some adventureous soul will take on the task
of updating it themselves (since the TeX sources are publically
available).

Even further, I keep hoping that maybe someday that someone will be
me.  I really want to do it, but every time I look at the thousands of
pages involved and the huge effort it would take I am daunted and give
up to go hack on something smaller.  And more rewarding.

The other option is to update the TeX sources to the draft version of
the ANSI spec and put it out.  But I'm not sure about the copyright on
it...  Whether redistributing a modified form would be legal...

> Good luck.  I'm happy so far.  Some people diss the "loop" macro, but
> I've been delighted by it.  This kind of thing is a real treat for me
> (it was ugly as sin when I did it in Java):

The only complaint people really have about the LOOP macro is that
even though what you had was as ugly as sin in Java, what you end up
with in Lisp is *still* ugly.

JONL's suggestion (and others have made the same) is that parentheses
be included into it.  Thus

>     (loop for c in player-cards
>           sum (card-blackjack-value c) into n
>           count (is-ace c) into n-aces
>           finally (return (if (and (> n-aces 0) (< n 12))
>                               (+ n 10)
>                             n)))

becomes something like

    (loop (for c in player-cards)
          (sum (card-blackjack-value c) into n)
          (count (is-ace c) into n-aces)
          (finally (return (if (and (> n-aces 0) (< n 12))
                               (+ n 10)
                               n))))

There are other variations as well, of course.  I'd like to see all
the keywords in LOOP become KEYWORDS, that is become symbols interned
in the KEYWORD package.  Then their status as LOOP keywords would be
more obvious in comparison to the other symbols used in any given
LOOP.  This would give you

    (loop :for c :in player-cards
          :sum (card-blackjack-value c) :into n
          :count (is-ace c) :into n-aces
          :finally (return (if (and (> n-aces 0) (< n 12))
                               (+ n 10)
                               n)))

This would at least obviate the need for more parens, like Lisp
doesn't have enough already.  ^_^  And it would make sense with LOOP
considered something like a function and its keyword arguments.

(BTW, I removed the two extra parens you had in your original example.
They were probably from some greater DEFUN, I guessed.)

'james

--
James A. Crippen <ja...@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.20939N, -149.767W
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.