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
(defun view (p1 p2 &aux r1 r2) ..
should work the same way as
(defun view (p1 p2)
(let (r1 r2) ..)
--
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
> > (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) ...
--
> * "Montse" <mon...@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
> 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)