> [Christophe Rhodes]
> 
> Vladimir Sekissov <[EMAIL PROTECTED]> writes:
> 
> > Can somebody explain which implementation give the correct result
> > running this code:
> >
> > (defvar *a* 1)
> >
> > (defmacro test-a () *a*)
> >
> > (progv '(*a*) '(2)  ;; [[ corrected typo ]]
> >   (test-a))

> Both 1 and 2 are correct answers: the difference arises from different
> evaluation strategies.  (In compiled code, both implementations must
> return 1).

To clarify, if you define

   (defun test-b ()
      (progv '(*a*) '(2)))

then

    (test-b)

should evaluate to 1.  Allegro works properly when test-b is compiled,
but returns 2 if test-b is interpreted.  I'm guessing CLISP has the
same problem.

I don't think different implementations are allowed to have
"evaluation strategies" that differ in this way.  I think it's a bug
(in Allegro and CLISP).

-- 

                                         -- Drew McDermott
                                            Yale University
                                            Computer Science Department


Reply via email to