From: david
Subject: newbie clos problem
Date: 
Message-ID: <pan.2006.05.20.11.10.41.2215@spam.net>
hello, i am trying to learn about clos.
i made a defclass like this:

(defclass person ()
   ((name :accessor name
          :initarg name)))

now i just want to make-instance an instance with a name.
nothing i try seems to work. please help.

From: Zach Beane
Subject: Re: newbie clos problem
Date: 
Message-ID: <m3odxtexw3.fsf@unnamed.xach.com>
david <····@spam.net> writes:

> hello, i am trying to learn about clos.
> i made a defclass like this:
> 
> (defclass person ()
>    ((name :accessor name
>           :initarg name)))
> 
> now i just want to make-instance an instance with a name.
> nothing i try seems to work. please help.

The symbol you used as the :initarg should precede the initialization
argument in make-instance:

   (make-instance 'person 'name "david")

It's pretty common to use keyword symbols as initargs:

   (defclass person ()
     ((name :accessor name
            :initarg :name)))

Then the make-instance would be:

   (make-instance 'person :name "david")

Zach
From: ·····@earthlink.net
Subject: Re: newbie clos problem
Date: 
Message-ID: <1148125341.347277.204880@j33g2000cwa.googlegroups.com>
Zach Beane wrote:
>
> The symbol you used as the :initarg should precede the initialization
> argument in make-instance:
>
>    (make-instance 'person 'name "david")
>
> It's pretty common to use keyword symbols as initargs:
>
>    (defclass person ()
>      ((name :accessor name
>             :initarg :name)))
>
> Then the make-instance would be:
>
>    (make-instance 'person :name "david")
> 
> Zach

problem solved, thank you very much :)