From: Montse
Subject: parameters with &aux
Date: 
Message-ID: <3a2f8d52$1@193.146.156.23>
 I don�t know how work parameters in lisp with &aux before their
            example  (defun view (p1 p2 &aux r1 r2) ..

     and I don�t know they work.

     I need know this for understand a problem,

    Can help me somebody and explain how they work??

    Thanks

From: Martti Halminen
Subject: Re: parameters with &aux
Date: 
Message-ID: <3A2F93C6.9402D7F7@solibri.com>
Montse wrote:
> 
>  I don�t know how work parameters in lisp with &aux before their
>             example  (defun view (p1 p2 &aux r1 r2) ..
> 
>      and I don�t know they work.


(defun view (p1 p2 &aux r1 r2) ..

  should work the same way as

(defun view (p1 p2)
  (let (r1 r2) ..)
--
From: Kent M Pitman
Subject: Re: parameters with &aux
Date: 
Message-ID: <sfwhf4gw35v.fsf@world.std.com>
Martti Halminen <···············@solibri.com> writes:

> Montse wrote:
> > 
> >  I don�t know how work parameters in lisp with &aux before their
> >             example  (defun view (p1 p2 &aux r1 r2) ..
> > 
> >      and I don�t know they work.
> 
> 
> (defun view (p1 p2 &aux r1 r2) ..
> 
>   should work the same way as
> 
> (defun view (p1 p2)
>   (let (r1 r2) ..)

Uh, LET* actually, not LET.  In the case you cite, there is no difference.
But you can do:

 (defun foo (x &aux (y (+ x 1)) (z (+ x y))) ...)

and it will bind variables left to right.

(Personally, I just never use &aux.  I think it bad style.)
From: Martti Halminen
Subject: Re: parameters with &aux
Date: 
Message-ID: <3A2FF8E7.7923B11D@solibri.com>
Kent M Pitman wrote:
> 
> Martti Halminen <···············@solibri.com> writes:

> > (defun view (p1 p2 &aux r1 r2) ..
> >
> >   should work the same way as
> >
> > (defun view (p1 p2)
> >   (let (r1 r2) ..)
> 
> Uh, LET* actually, not LET.  In the case you cite, there is no difference.
> But you can do:
> 
>  (defun foo (x &aux (y (+ x 1)) (z (+ x y))) ...)
> 
> and it will bind variables left to right.
> 
> (Personally, I just never use &aux.  I think it bad style.)

Yeah, I so seldom use it I haven't needed that much detail. About the
only place I've needed it was when modifying some AutoLisp stuff to run
in CL, and was too lazy to add the let/let*.
  - AutoLisp is even more odd style: (defun view (p1 p2 / r1 r2) ...

--
From: Erik Naggum
Subject: Re: parameters with &aux
Date: 
Message-ID: <3185184845826819@naggum.net>
* "Montse" <······@issnet.net>
| I don�t know how work parameters in lisp with &aux before their
| example  (defun view (p1 p2 &aux r1 r2) ..
| and I don�t know they work.
| 
| I need know this for understand a problem,
| 
| Can help me somebody and explain how they work??

  They are just like let-bindings in the function body.

(defun view (p1 p2 &aux r1 r2)
  ...)

  is functionally identical to

(defun view (p1 p2)
  (let (r1 r2)
    ..))

#:Erik
-- 
  "When you are having a bad day and it seems like everybody is trying
   to piss you off, remember that it takes 42 muscles to produce a
   frown, but only 4 muscles to work the trigger of a good sniper rifle."
								-- Unknown
From: Sunil Mishra
Subject: Re: parameters with &aux
Date: 
Message-ID: <3A2FC879.4070104@everest.com>
Erik Naggum wrote:

> * "Montse" <······@issnet.net>
> | I don�t know how work parameters in lisp with &aux before their
> | example  (defun view (p1 p2 &aux r1 r2) ..
> | and I don�t know they work.
> | 
> | I need know this for understand a problem,
> | 
> | Can help me somebody and explain how they work??
> 
>   They are just like let-bindings in the function body.
> 
> (defun view (p1 p2 &aux r1 r2)
>   ...)
> 
>   is functionally identical to
> 
> (defun view (p1 p2)
>   (let (r1 r2)
>     ..))
> 
> #:Erik

A slight error here. CLHS 3.4.1.5:


&aux variable processing is analogous to let* processing.

(lambda (x y &aux (a (car x)) (b 2) c) (list x y a b c))
     ==  (lambda (x y) (let* ((a (car x)) (b 2) c) (list x y a b c)))

S