[armedbear-devel] Symbol-macro patch

Alessio Stalla alessiostalla at gmail.com
Wed Nov 2 19:03:01 UTC 2011


Greetings,

following up from my earlier mail about FSet and ABCL, I propose a
patch (attached) to fix ABCL's symbol-macro implementation not to use
the symbol's global value slot. Local symbol macros still use the same
storage location as variables, since it's not possible to use
symbol-value on local variables and it is forbidden to both declare a
variable special and associate a symbol macro to its name. I also
simplified some code that did not make use of this assumption, and
specially handled cases where a symbol was both naming a special
variable and a symbol macro.

An inconsistency remains:

(defvar foo)
(define-symbol-macro foo nil)

signals an error, while

(define-symbol-macro foo nil)
(defvar foo)

does not. This behaviour is present in stock ABCL as well, and
apparently it's allowed by the ANSI standard, although at least SBCL
consistently signals an error in both cases. I believe we should do
so, too. But I think it pertains to another patch.

Please test the patch with your own code; I ran the ANSI test suite
and got no regressions, but I'm not very confident about it -
apparently it doesn't cover symbol macros very well or at all, since
at one time I ran it with define-symbol-macro effectively
unimplemented and it happily reported the same 19-20 failures it did
before.

Cheers,
Alessio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: symbol-macros.patch
Type: text/x-patch
Size: 12167 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20111102/888279b1/attachment.bin>


More information about the armedbear-devel mailing list