I don't know why, but I am able to access a slot via a generic reader
function, but not using the slot-value function.
I can make the following call
CL-USER> (autocode::property-name *myloanobj*)
"hello"
but the following
CL-USER> (slot-value *myloanobj* `property-name)
gives me this error
Error in function "DEFMETHOD SLOT-MISSING (T T T T)":
When attempting to read the slot's value (slot-value), the slot
PROPERTY-NAME is missing from the object .
[Condition of type SIMPLE-ERROR]
Restarts:
0: [ABORT-REQUEST] Abort handling SLIME request.
1: [ABORT] Return to Top-Level.
Is there any reason why this should be happening? Or is this a bug in
the CMUCL implementation?
this is the defclass for *myloanobj*
(DEFCLASS LOAN (USER::NAMED-OBJECT)
((PROPERTY-NAME :INITFORM NIL
:INITARG :PROPERTY-NAME
:READER PROPERTY-NAME)
(ADDRESS :INITFORM (ERROR "Error, must supply ADDRESS")
:INITARG :ADDRESS
:READER ADDRESS)
(CITY :INITFORM (ERROR "Error, must supply CITY")
:INITARG :CITY
:READER CITY)
(STATE :INITFORM (ERROR "Error, must supply STATE")
:INITARG :STATE
:READER STATE))
)
access to address, city and state works as they should, I can access
them through both the reader and the slot-value function.
Can anyone shed some light on this?
"sickfaichezi" <············@gmail.com> writes:
> I don't know why, but I am able to access a slot via a generic reader
> function, but not using the slot-value function.
>
> I can make the following call
>
> CL-USER> (autocode::property-name *myloanobj*)
> "hello"
>
> but the following
>
> CL-USER> (slot-value *myloanobj* `property-name)
>
> gives me this error
>
> Error in function "DEFMETHOD SLOT-MISSING (T T T T)":
> When attempting to read the slot's value (slot-value), the slot
> PROPERTY-NAME is missing from the object .
> [Condition of type SIMPLE-ERROR]
>
> Restarts:
> 0: [ABORT-REQUEST] Abort handling SLIME request.
> 1: [ABORT] Return to Top-Level.
>
>
> Is there any reason why this should be happening? Or is this a bug in
> the CMUCL implementation?
>
> this is the defclass for *myloanobj*
>
> (DEFCLASS LOAN (USER::NAMED-OBJECT)
> ((PROPERTY-NAME :INITFORM NIL
> :INITARG :PROPERTY-NAME
> :READER PROPERTY-NAME)
> (ADDRESS :INITFORM (ERROR "Error, must supply ADDRESS")
> :INITARG :ADDRESS
> :READER ADDRESS)
> (CITY :INITFORM (ERROR "Error, must supply CITY")
> :INITARG :CITY
> :READER CITY)
> (STATE :INITFORM (ERROR "Error, must supply STATE")
> :INITARG :STATE
> :READER STATE))
> )
>
> access to address, city and state works as they should, I can access
> them through both the reader and the slot-value function.
>
> Can anyone shed some light on this?
Perhaps it's in another package; for example:
(slot-value object 'autocode::property-name)
--
__Pascal Bourguignon__ http://www.informatimago.com/
Grace personified,
I leap into the window.
I meant to do that.