[ansi-test-devel] Wrong test?

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Mon Dec 26 15:26:51 UTC 2011


(MACROLET ((%M (Z)
                   Z))
        (CTYPECASE (EXPAND-IN-CURRENT-ENV (%M :FOO))
          (INTEGER :BAD1)
          (KEYWORD :GOOD)
          (SYMBOL :BAD2)))

What is this supposed to check? In ECL this leads to the following code

(CTYPECASE :FOO
          (INTEGER :BAD1)
          (KEYWORD :GOOD)
          (SYMBOL :BAD2)))

This is in my opinion wrong.. CTYPECASE is supposed to contain a form for a
correctable error, including a replacement of the value of the form, in
this case :FOO. This means CTYPECASE expands at some point to (SETF :FOO
...) which is not a valid code, given that :FOO is a constant.

I know that SBCL and probably other implementations do not complain about
this until the assignment is performed, but this does not mean that the
code is valid.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ansi-test-devel/attachments/20111226/bf43ef96/attachment.html>


More information about the ansi-test-devel mailing list