[armedbear-devel] FSet on ABCL
alessiostalla at gmail.com
Wed Oct 26 17:12:41 UTC 2011
as part of my nth plan to conquer the world (which of course I won't
unveil right now), I tried FSet on ABCL. I managed to make it run, but
I had to patch it; you can find the patch attached (it's taken against
the version in Quicklisp, but I believe it's the latest version).
Besides some minor #+abcl porting stuff, the one thing that stuck out
was the DEFLEX macro for defining global lexical variables, which
conflicts with ABCL's implementation of symbol macros.
(deflex var) expands basically into (define-symbol-macro var
(symbol-value 'var)). The problem: ABCL stores symbol macros in the
value cell of symbols, so you can't have a symbol which is both a
variable and a symbol macro.
Now, I believe deflex as written is non portable CL. This is because
accessing the symbol-value of an unbound variable is, to my
interpretation, unspecified [*]; and if you use defvar/defparameter
with var, then you cannot use it as a symbol macro. Thus, I patched it
(taking inspiration from Rob Warnock's version of deflex/defglobal).
However, I do think ABCL's implementation is very brittle (and
probably conflicting with ANSI as well), because if you setf the
symbol-value of a symbol with a global symbol macro attached, you
remove the symbol macro! So, I think we should fix it for 1.0.1.
Perhaps I can do the fix myself, but we better discuss it before
because I fear this might be a deep change.
[*] symbol-value ... Accesses the symbol's value cell. 
value cell n. Trad. (of a symbol) The place which holds the value, if
any, of the dynamic variable named by that symbol, and which is
accessed by symbol-value. 
dynamic variable n. a variable the binding for which is in the dynamic
I don't think a symbol for which there is no special declaration in
scope can be considered to name a dynamic variable, and thus to have a
value cell at all.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3514 bytes
Desc: not available
More information about the armedbear-devel