Ok, I got how it works. (eval 'Exp 'Num) If 'Exp contains @, the value of @ in the 'Num higher environment will be used. For example:
(setq A (2 1)) (let @ 4 (cons @ (eval '(cons 3 @) 3))) -> (4 3 2 1) if '@ is not used in the expression, it will have no effect. On Sat, May 15, 2021 at 10:19 PM polifemo <brunofrancosala...@gmail.com> wrote: > the doc of 'eval says this: > > (eval 'any ['cnt]) -> any > Evaluates any. Note that because of the standard argument evaluation, any > is actually evaluated twice. > > If an offset cnt is given, the value of @ in the > cnt'th call environment is used during the second evaluation. cnt should > be greater than zero. See also run and up. > > I'm having a hard time understanding what the 'cnt value does. I thought > it would use the value of the 'any that is 'cnt positions up, like 'up > does, but then this test code does not behave as I expect: > > (setq A (2 1)) > (let A 3 (list A (eval 'A) (eval 'A 2) (up 2 A))) > -> (3 3 3 (2 1)) > instead of (3 (2 1) (2 1)), which is what I expected. > > would someone help me understand? > > >