December 11, 2001
Portability 3: Structures, Slots and Conditions

I always wondered whether the with-slots macro was legal to use on structures. The answer turns out to be that it is not.

Some of the code in the assertional memory module used with-slots on structures. This code worked in ACL and MCL, but did not work in CMUCL. with-slots is defined in terms of slot-value, and the Hyperspec says that the behavior of slot-value depends on the metaclass of the object it is applied to:

  • standard-class (defined with defclass) : never an error.
  • built-in-class (possibly types like string and T): always an error.
  • anything else: unspecified; maybe it will be an error, maybe not.

The spec goes on to say "Note in particular that the behavior for conditions and structures is not specified." Which means don't count on it working (and don't count on it not working).

At least this was not a particularly difficult change to make in the code.

Posted by jjwiseman at December 11, 2001 09:35 PM
Comments
Post a comment
Name:


Email Address:


URL:




Unless you answer this question, your comment will be classified as spam and will not be posted.
(I'll give you a hint: the answer is “lisp”.)

Comments:


Remember info?