From: ·········@olive-it.ch
Subject: make-instance of clsql:def-view-class
Date: 
Message-ID: <1186098623.045798.125460@x40g2000prg.googlegroups.com>
Consider this:
(clsql:def-view-class person ()
  ((pid :db-kind :key
       :db-constraints :not-null
       :type integer)
   (uid
       :type integer)
   (firstname :type (string 250))
   (lastname :type (string 250))
   (email :type (string 250))))

(defvar p1 (make-instance 'person :firstname "wer" :lastname
"bush" :email ····@r" :uid 1 :pid 2))

Now,
CL-USER> p1
#<PERSON {B387C41}>
CL-USER> (slot-value p1 'firstname)
   [Condition of type UNBOUND-SLOT]
  The slot FIRSTNAME is unbound in the object #<PERSON {A6A7001}>.

Sorry to ask, but shouldn't make-instance bind the slot firstname to
the value "wer" ?
Must be some top-notch-stupid error, but I just dont get it.
thanx

From: Ralf Mattes
Subject: Re: make-instance of clsql:def-view-class
Date: 
Message-ID: <f8tsf0$5h6$1@news01.versatel.de>
On Thu, 02 Aug 2007 16:50:23 -0700, google.bo wrote:

> Consider this:
> (clsql:def-view-class person ()
>   ((pid :db-kind :key
>        :db-constraints :not-null
>        :type integer)
>    (uid
>        :type integer)
>    (firstname :type (string 250))
>    (lastname :type (string 250))
>    (email :type (string 250))))
> 
> (defvar p1 (make-instance 'person :firstname "wer" :lastname
> "bush" :email ····@r" :uid 1 :pid 2))
> 
> Now,
> CL-USER> p1
> #<PERSON {B387C41}>
> CL-USER> (slot-value p1 'firstname)
>    [Condition of type UNBOUND-SLOT]
>   The slot FIRSTNAME is unbound in the object #<PERSON {A6A7001}>.
> 
> Sorry to ask, but shouldn't make-instance bind the slot firstname to
> the value "wer" ?
> Must be some top-notch-stupid error, but I just dont get it.

Maybe add an ':initarg :firstname' to the 'firstname slot options?

 Cheers, Ralf Mattes

> thanx
From: ·········@olive-it.ch
Subject: Re: make-instance of clsql:def-view-class
Date: 
Message-ID: <1186101337.462471.175880@e16g2000pri.googlegroups.com>
On 3 Aug., 02:21, Ralf Mattes <····@mh-freiburg.de> wrote:
> On Thu, 02 Aug 2007 16:50:23 -0700, google.bo wrote:
> > Consider this:
> > (clsql:def-view-class person ()
> >   ((pid :db-kind :key
> >        :db-constraints :not-null
> >        :type integer)
> >    (uid
> >        :type integer)
> >    (firstname :type (string 250))
> >    (lastname :type (string 250))
> >    (email :type (string 250))))
>
> > (defvar p1 (make-instance 'person :firstname "wer" :lastname
> > "bush" :email ····@r" :uid 1 :pid 2))
>
> > Now,
> > CL-USER> p1
> > #<PERSON {B387C41}>
> > CL-USER> (slot-value p1 'firstname)
> >    [Condition of type UNBOUND-SLOT]
> >   The slot FIRSTNAME is unbound in the object #<PERSON {A6A7001}>.
>
> > Sorry to ask, but shouldn't make-instance bind the slot firstname to
> > the value "wer" ?
> > Must be some top-notch-stupid error, but I just dont get it.
>
> Maybe add an ':initarg :firstname' to the 'firstname slot options?
Right
I read, I typed, I banged my head very hard (multiple times) on my
tabel
Oh hell, THAT obvious, I just thought the accessor would be defined
automatic.
However, the example in the clsql user guide has it, too.
So rtfm
>
>  Cheers, Ralf Mattes
Thanx very much indeed