[armedbear-devel] [Bug] Identically named gensymed coalesced into same object in fasl file

Tobias C. Rittweiler tcr at freebits.de
Mon Jan 11 21:35:27 UTC 2010

I'm currently running an old checkout ("0.17.0-dev"), so the issue may
have been fixed meanwhile.

  ### /tmp/foo.lisp
  (eval-when (:load-toplevel :execute)
    (let ((a '#:foo)
          (b '#:foo))
      (setf (fdefinition 'foo) (lambda () (values a b)))))

  (eval-when (:load-toplevel :execute)
    (format t "~&(multiple-value-call #'eq (foo)) => ~S~%"
            (multiple-value-call #'eq (foo))))

  CL-USER> (compile-file "/tmp/foo.lisp")
  ; Compiling /tmp/foo.lisp ...
  ; (LET (# #) ...)
  ; (FORMAT T ...)

  ; Compilation unit finished
  ;   The following functions were used but not defined:
  ;     FOO

  ; Wrote /tmp/foo.abcl (0.034 seconds)

That warning is bogus. There some work in this area so this bit may be
fixed already.

The actual issue of my mail is this one, though:

  CL-USER> (load *)
  (multiple-value-call #'eq (foo)) => T

As you can see, ABCL coalesces the two identical named gensyms into the
same object in the fasl file.

While does specify that

  Two apparently uninterned symbols S and C are similar if their names
  are similar.

ABCL's behavior is still wrong because says

  If two literal objects appearing in the source code for a single file
  processed with the file compiler are the [sic] identical, the
  corresponding objects in the compiled code must also be the
  identical. __With the exception of symbols and packages__, any two
  literal objects in code being processed by the file compiler may be
  coalesced if and only if they are similar; __if they are either both
  symbols or both packages, they may only be coalesced if and only if
  they are identical__.


More information about the armedbear-devel mailing list