From: sickfaichezi
Subject: Something Strange with slot-value vs readers
Date: 
Message-ID: <1132288969.551364.4560@g47g2000cwa.googlegroups.com>
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?

From: Pascal Bourguignon
Subject: Re: Something Strange with slot-value vs readers
Date: 
Message-ID: <87oe4i5y7n.fsf@thalassa.informatimago.com>
"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.
From: sickfaichezi
Subject: Re: Something Strange with slot-value vs readers
Date: 
Message-ID: <1132295717.611920.222310@g49g2000cwa.googlegroups.com>
Yep, that was it. Thanks for your help!