[armedbear-devel] SLOT-VALUE and SLOT-VALUE-USING-CLASS with DEFSTRUCT

William Wadsworth will.wadsworth.10 at gmail.com
Mon Jun 14 02:09:47 UTC 2010


Hi.

The following transcript demonstrates the problem.

--- BEGIN
Armed Bear Common Lisp 0.20.0
Java 1.6.0_20 Sun Microsystems Inc.
Java HotSpot(TM) Client VM
Low-level initialization completed in 0.667 seconds.
Startup completed in 4.849 seconds.
Type ":help" for a list of available commands.
CL-USER(1): (defstruct x a b c)
X
CL-USER(2): (slot-value (make-x :a 10) 'a)
#<THREAD "interpreter" {118958E}>: Debugger invoked on condition of
type UNDEFINED-FUNCTION
  The function SLOT-VALUE is undefined.
Restarts:
  0: CONTINUE     Try again.
  1: USE-VALUE    Specify a function to call instead.
  2: RETURN-VALUE Return one or more values from the call to SLOT-VALUE.
  3: TOP-LEVEL    Return to top level.
[1] CL-USER(3): :res
CL-USER(4): (slot-value (make-x :a 10) 'a)
#<THREAD "interpreter" {118958E}>: Debugger invoked on condition of
type SIMPLE-ERROR
  There is no applicable method for the generic function
#<STANDARD-GENERIC-FUNCTION MOP::SLOT-VALUE-USING-CLASS {932FE}
> when called with arguments (#<STRUCTURE-CLASS X {11EF443}> #<X {1184326}> A).
Restarts:
  0: TOP-LEVEL Return to top level.
[1] CL-USER(5): :res
CL-USER(6):
--- END

DEFCLASS seems to work fine, though I would like to keep using DEFSTRUCT.
I understand that the MOP is not really complete. However, Is there a workaround
that will not resort in using DEFCLASS?

---
Martin.




More information about the armedbear-devel mailing list