From: Mike Chu
Subject: a quick question!
Date: 
Message-ID: <36BE7A97.B376C86E@hotmail.com>
Excuse me, could people tell me what the following statement is doing?
(let ( y (+1 x))
Does it mean that y is now set as a local variable, and y equals x + 1??

thanks for ur answer!!!

From: Barry Margolin
Subject: Re: a quick question!
Date: 
Message-ID: <pivv2.2037$oD6.84813@burlma1-snr1.gtei.net>
In article <·················@hotmail.com>,
Mike Chu  <······@hotmail.com> wrote:
>Excuse me, could people tell me what the following statement is doing?
>(let ( y (+1 x))
>Does it mean that y is now set as a local variable, and y equals x + 1??

It binds the local variable Y to NIL, and binds the local variable +1 to
the value of X; i.e. it's equivalent to:

(let ((y nil)
      (+1 x))

If it were:

(let ((y (+ 1 x)))

it would be doing what you described.  See the documentation of the LET
form to understand why the extra level of parentheses are necessary, and
the documentation of symbol and function call syntax to understand why the
space after the + is important.

-- 
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Don't bother cc'ing followups to me.
From: Johan Kullstam
Subject: Re: a quick question!
Date: 
Message-ID: <m2aeypv2qg.fsf@sophia.axel.nom>
Mike Chu <······@hotmail.com> writes:

> Excuse me, could people tell me what the following statement is doing?
> (let ( y (+1 x))
> Does it mean that y is now set as a local variable, and y equals x + 1??

yes.  except you either lost a space or transposed two chars as in:

(let (y (+ 1 x))
  <body>)

(let (y (1+ x))
  <body>)

the <body> has a variable y set to x+1.

-- 
Johan Kullstam [········@ne.mediaone.net] Don't Fear the Penguin!