GNU bug report logs -
#77278
29.4; eval bug with lexical environment
Previous Next
Full log
View this message in rfc822 format
"Daniel Cerqueira" <dan.freesoftware <at> lispclub.com> writes:
> Eval this expression:
> (eval '(cons (quote a) x) '((x b)))
>
> It returns (a b) , it should return (a . b) .
The LEXENV argument to eval is an alist. So
(eval '(cons (quote a) x) '((x . b)))
is what you want, and that does evaluate to (a . b).
> Also, eval this expression:
> (eval '(atom x) '((x b)))
>
> It returns nil , it should return t .
Same thing. '((x b)) is equivalent to '((x . (b))), binding (b) to x,
so x is a list, not an atom.
> Since eval is the most important part of a LISP environment, it is good
> pratice to create a unit test to test eval, so that bugs in eval are
> easier to spot.
There are a few, it seems, in eval-tests.el. However, if you'd like to
suggest more, that would be a good thing.
Pip
This bug report was last modified 80 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.