From: Angus77
Subject: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <8af6406d-d33d-421f-bf11-0d0d8d8e1eb1@v1g2000pra.googlegroups.com>
Hello!  I'm certainly no Lisp expert---I'm baffled by why something
like this won't work:

(defclass monkey ()
              ((name
                :initarg :name
                :accessor name)
               (species
                :initarg :species
                :accessor species)))

(defparameter gorilla (make-instance 'gorilla :name "King" :species
"gorilla"))
(defparameter chimp (make-instance 'gorilla :name "Chimpy" :species
"chimpanzee"))
(setq monkeys '(gorilla chimp))

(loop for x in monkeys
	      do (progn
		   (format t "~a~%" (name x))
		   (format t "~a~%~%" (species x))))

I get this error:

There is no applicable method for the generic function
  #<STANDARD-GENERIC-FUNCTION NAME (1)>
when called with arguments
  (GORILLA).

even though this works:

(format t "~a~%" (name gorilla))

What gives?  I'd appreciate an explanation more than a solution
(although solutions would also be welcome!)

From: Dan Weinreb
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <82c0ae98-a3bb-4cee-8e43-7a405e5f7cf1@a70g2000hsh.googlegroups.com>
On Aug 14, 2:12 am, Angus77 <··········@gmail.com> wrote:
> Hello!  I'm certainly no Lisp expert---I'm baffled by why something
> like this won't work:
>
> (defclass monkey ()
>               ((name
>                 :initarg :name
>                 :accessor name)
>                (species
>                 :initarg :species
>                 :accessor species)))
>
> (defparameter gorilla (make-instance 'gorilla :name "King" :species
> "gorilla"))
> (defparameter chimp (make-instance 'gorilla :name "Chimpy" :species
> "chimpanzee"))
> (setq monkeys '(gorilla chimp))
>
> (loop for x in monkeys
>               do (progn
>                    (format t "~a~%" (name x))
>                    (format t "~a~%~%" (species x))))
>
> I get this error:
>
> There is no applicable method for the generic function
>   #<STANDARD-GENERIC-FUNCTION NAME (1)>
> when called with arguments
>   (GORILLA).
>
> even though this works:
>
> (format t "~a~%" (name gorilla))
>
> What gives?  I'd appreciate an explanation more than a solution
> (although solutions would also be welcome!)

It can't work, because chimps are not gorillas, and they are apes, not
monkeys at all.

No, seriously, you want

(setq monkeys (list gorilla chip))

as several people pointed out.  Let us know if you need more help.

-- Dan
From: Angus77
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <0b62b44a-ea8d-48b4-9d5f-597df6675a3b@o40g2000prn.googlegroups.com>
On Aug 14, 7:45 pm, Dan Weinreb <····@alum.mit.edu> wrote:
> On Aug 14, 2:12 am, Angus77 <··········@gmail.com> wrote:
>
>
>
> > Hello!  I'm certainly no Lisp expert---I'm baffled by why something
> > like this won't work:
>
> > (defclass monkey ()
> >               ((name
> >                 :initarg :name
> >                 :accessor name)
> >                (species
> >                 :initarg :species
> >                 :accessor species)))
>
> > (defparameter gorilla (make-instance 'gorilla :name "King" :species
> > "gorilla"))
> > (defparameter chimp (make-instance 'gorilla :name "Chimpy" :species
> > "chimpanzee"))
> > (setq monkeys '(gorilla chimp))
>
> > (loop for x in monkeys
> >               do (progn
> >                    (format t "~a~%" (name x))
> >                    (format t "~a~%~%" (species x))))
>
> > I get this error:
>
> > There is no applicable method for the generic function
> >   #<STANDARD-GENERIC-FUNCTION NAME (1)>
> > when called with arguments
> >   (GORILLA).
>
> > even though this works:
>
> > (format t "~a~%" (name gorilla))
>
> > What gives?  I'd appreciate an explanation more than a solution
> > (although solutions would also be welcome!)
>
> It can't work, because chimps are not gorillas, and they are apes, not
> monkeys at all.
>
> No, seriously, you want
>
> (setq monkeys (list gorilla chip))
>
> as several people pointed out.  Let us know if you need more help.
>
> -- Dan

Yeah, I actually realized that.  I should have just cut and pasted the
actual code, but, well...the original is pretty gross to look at (and
has nothing to do with monkeys and apes.  It's actually for an
educational games database.  And very poorly written...).
From: ········@gmail.com
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <f416865d-11d2-4055-961c-00766ca77d8e@e39g2000hsf.googlegroups.com>
On Aug 14, 7:39 am, Angus77 <··········@gmail.com> wrote:

>  I should have just cut and pasted the
> actual code, but, well...the original is pretty gross to look at

Well, coming up with a simpler test case is always a good idea.  The
thing to remember if there's a next time is that you need to *test*
the simpler case, to make sure it's valid.
From: Rainer Joswig
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <joswig-41C648.08573814082008@news-europe.giganews.com>
In article 
<····································@v1g2000pra.googlegroups.com>,
 Angus77 <··········@gmail.com> wrote:

> Hello!  I'm certainly no Lisp expert---I'm baffled by why something
> like this won't work:
> 
> (defclass monkey ()
>               ((name
>                 :initarg :name
>                 :accessor name)
>                (species
>                 :initarg :species
>                 :accessor species)))
> 
> (defparameter gorilla (make-instance 'gorilla :name "King" :species
> "gorilla"))
> (defparameter chimp (make-instance 'gorilla :name "Chimpy" :species
> "chimpanzee"))
> (setq monkeys '(gorilla chimp))

Probably you wanted a list of objects and not a list of symbols?

(defparameter *monkeys* (list gorilla chimp))

Btw., make sure that you write your global special variables
as   *some-variable*  . This way they don't conflict with any
lexical variables.

> 
> (loop for x in monkeys
> 	      do (progn
> 		   (format t "~a~%" (name x))
> 		   (format t "~a~%~%" (species x))))
> 
> I get this error:
> 
> There is no applicable method for the generic function
>   #<STANDARD-GENERIC-FUNCTION NAME (1)>
> when called with arguments
>   (GORILLA).

Sure, you were iterating over a list of symbols. You
surely did not define the NAME for symbols.
NAME was generated by above MONKEY class definition.
As a method for objects of class monkey.


> 
> even though this works:
> 
> (format t "~a~%" (name gorilla))

gorilla is a variable that has an object of class monkey,
so the generic function NAME has an applicable method.


> 
> What gives?  I'd appreciate an explanation more than a solution
> (although solutions would also be welcome!)

-- 
http://lispm.dyndns.org/
From: Angus77
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <159f206f-3f0b-41ae-bd5e-e1955845e85c@p31g2000prf.googlegroups.com>
On Aug 14, 3:57 pm, Rainer Joswig <······@lisp.de> wrote:
> In article
> <····································@v1g2000pra.googlegroups.com>,
>
>

>
> Probably you wanted a list of objects and not a list of symbols?
>
> (defparameter *monkeys* (list gorilla chimp))
>
> Btw., make sure that you write your global special variables
> as   *some-variable*  . This way they don't conflict with any
> lexical variables.
>
>
>
> > (loop for x in monkeys
> >          do (progn
> >               (format t "~a~%" (name x))
> >               (format t "~a~%~%" (species x))))
>
> > I get this error:
>
> > There is no applicable method for the generic function
> >   #<STANDARD-GENERIC-FUNCTION NAME (1)>
> > when called with arguments
> >   (GORILLA).
>
> Sure, you were iterating over a list of symbols. You
> surely did not define the NAME for symbols.
> NAME was generated by above MONKEY class definition.
> As a method for objects of class monkey.
>
>
>
> > even though this works:
>
> > (format t "~a~%" (name gorilla))
>
> gorilla is a variable that has an object of class monkey,
> so the generic function NAME has an applicable method.
>
>
>
> > What gives?  I'd appreciate an explanation more than a solution
> > (although solutions would also be welcome!)
>
> --http://lispm.dyndns.org/

Thanks!  That solved it.
From: Kenny
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <48a3dcdf$0$29526$607ed4bc@cv.net>
Rainer Joswig wrote:
> In article 
> <····································@v1g2000pra.googlegroups.com>,
>  Angus77 <··········@gmail.com> wrote:
> 
>> Hello!  I'm certainly no Lisp expert---I'm baffled by why something
>> like this won't work:
>>
>> (defclass monkey ()
>>               ((name
>>                 :initarg :name
>>                 :accessor name)
>>                (species
>>                 :initarg :species
>>                 :accessor species)))
>>
>> (defparameter gorilla (make-instance 'gorilla :name "King" :species
>> "gorilla"))
>> (defparameter chimp (make-instance 'gorilla :name "Chimpy" :species
>> "chimpanzee"))
>> (setq monkeys '(gorilla chimp))
> 
> Probably you wanted a list of objects and not a list of symbols?
> 
> (defparameter *monkeys* (list gorilla chimp))

Ah, nice catch.

To the OP, this is a problem with Lisp tutorials. They understandably 
enough use things like '(1 2 3) and '(a b c) to establish lists in their 
simple examples. Unfortunately many noobs then think one can do things 
like this: (let ((a 1) (b 2)) '(a b)) and get back a list of 1 and 2. 
Nope, the tick means QUOTE, which does not evaluate a and b for their 
values.

btw, a more common gotcha is folks then thinking they can modify lists 
formed with quote. Those kinda belong to the compiler, you can't modify 
those just as you should not modify C string literals.

kt


-- 

$$$$$: http://www.theoryyalgebra.com/
Cells: http://common-lisp.net/project/cells/
BSlog: http://smuglispweeny.blogspot.com/
From: Angus77
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <75da8512-c54c-41da-b69a-4a484b86d544@n38g2000prl.googlegroups.com>
On Aug 14, 4:21 pm, Kenny <·········@gmail.com> wrote:
> Rainer Joswig wrote:
> > In article
> > <····································@v1g2000pra.googlegroups.com>,
> >  Angus77 <··········@gmail.com> wrote:
>
> >> Hello!  I'm certainly no Lisp expert---I'm baffled by why something
> >> like this won't work:
>
> >> (defclass monkey ()
> >>               ((name
> >>                 :initarg :name
> >>                 :accessor name)
> >>                (species
> >>                 :initarg :species
> >>                 :accessor species)))
>
> >> (defparameter gorilla (make-instance 'gorilla :name "King" :species
> >> "gorilla"))
> >> (defparameter chimp (make-instance 'gorilla :name "Chimpy" :species
> >> "chimpanzee"))
> >> (setq monkeys '(gorilla chimp))
>
> > Probably you wanted a list of objects and not a list of symbols?
>
> > (defparameter *monkeys* (list gorilla chimp))
>
> Ah, nice catch.
>
> To the OP, this is a problem with Lisp tutorials. They understandably
> enough use things like '(1 2 3) and '(a b c) to establish lists in their
> simple examples. Unfortunately many noobs then think one can do things
> like this: (let ((a 1) (b 2)) '(a b)) and get back a list of 1 and 2.
> Nope, the tick means QUOTE, which does not evaluate a and b for their
> values.
>
> btw, a more common gotcha is folks then thinking they can modify lists
> formed with quote. Those kinda belong to the compiler, you can't modify
> those just as you should not modify C string literals.
>
> kt
>
> --
>
> $$$$$:http://www.theoryyalgebra.com/
> Cells:http://common-lisp.net/project/cells/
> BSlog:http://smuglispweeny.blogspot.com/

So does this mean one should use (list nil) to create an empty list
instead of '()?
From: Paul Donnelly
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <87ljz0ui83.fsf@plap.localdomain>
Angus77 <··········@gmail.com> writes:

> On Aug 14, 4:21 pm, Kenny <·········@gmail.com> wrote:
>> Rainer Joswig wrote:
>> > In article
>> > <····································@v1g2000pra.googlegroups.com>,
>> >  Angus77 <··········@gmail.com> wrote:
>>
>> >> Hello!  I'm certainly no Lisp expert---I'm baffled by why something
>> >> like this won't work:
>>
>> >> (defclass monkey ()
>> >>               ((name
>> >>                 :initarg :name
>> >>                 :accessor name)
>> >>                (species
>> >>                 :initarg :species
>> >>                 :accessor species)))
>>
>> >> (defparameter gorilla (make-instance 'gorilla :name "King" :species
>> >> "gorilla"))
>> >> (defparameter chimp (make-instance 'gorilla :name "Chimpy" :species
>> >> "chimpanzee"))
>> >> (setq monkeys '(gorilla chimp))
>>
>> > Probably you wanted a list of objects and not a list of symbols?
>>
>> > (defparameter *monkeys* (list gorilla chimp))
>>
>> Ah, nice catch.
>>
>> To the OP, this is a problem with Lisp tutorials. They understandably
>> enough use things like '(1 2 3) and '(a b c) to establish lists in their
>> simple examples. Unfortunately many noobs then think one can do things
>> like this: (let ((a 1) (b 2)) '(a b)) and get back a list of 1 and 2.
>> Nope, the tick means QUOTE, which does not evaluate a and b for their
>> values.
>>
>> btw, a more common gotcha is folks then thinking they can modify lists
>> formed with quote. Those kinda belong to the compiler, you can't modify
>> those just as you should not modify C string literals.
>>
>> kt
>>
>> --
>>
>> $$$$$:http://www.theoryyalgebra.com/
>> Cells:http://common-lisp.net/project/cells/
>> BSlog:http://smuglispweeny.blogspot.com/
>
> So does this mean one should use (list nil) to create an empty list
> instead of '()?

No, because (AND (EQ '() NIL) (EQ (TYPE-OF NIL) NULL)). It isn't a
cons, and isn't mutable. There's nothing you can do to it, so it's
safe to use for the empty list.
From: Kenny
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <48a3edeb$0$29516$607ed4bc@cv.net>
Angus77 wrote:
> On Aug 14, 4:21 pm, Kenny <·········@gmail.com> wrote:
>> Rainer Joswig wrote:
>>> In article
>>> <····································@v1g2000pra.googlegroups.com>,
>>>  Angus77 <··········@gmail.com> wrote:
>>>> Hello!  I'm certainly no Lisp expert---I'm baffled by why something
>>>> like this won't work:
>>>> (defclass monkey ()
>>>>               ((name
>>>>                 :initarg :name
>>>>                 :accessor name)
>>>>                (species
>>>>                 :initarg :species
>>>>                 :accessor species)))
>>>> (defparameter gorilla (make-instance 'gorilla :name "King" :species
>>>> "gorilla"))
>>>> (defparameter chimp (make-instance 'gorilla :name "Chimpy" :species
>>>> "chimpanzee"))
>>>> (setq monkeys '(gorilla chimp))
>>> Probably you wanted a list of objects and not a list of symbols?
>>> (defparameter *monkeys* (list gorilla chimp))
>> Ah, nice catch.
>>
>> To the OP, this is a problem with Lisp tutorials. They understandably
>> enough use things like '(1 2 3) and '(a b c) to establish lists in their
>> simple examples. Unfortunately many noobs then think one can do things
>> like this: (let ((a 1) (b 2)) '(a b)) and get back a list of 1 and 2.
>> Nope, the tick means QUOTE, which does not evaluate a and b for their
>> values.
>>
>> btw, a more common gotcha is folks then thinking they can modify lists
>> formed with quote. Those kinda belong to the compiler, you can't modify
>> those just as you should not modify C string literals.
>>
>> kt
>>
>> --
>>
>> $$$$$:http://www.theoryyalgebra.com/
>> Cells:http://common-lisp.net/project/cells/
>> BSlog:http://smuglispweeny.blogspot.com/
> 
> So does this mean one should use (list nil) to create an empty list
> instead of '()?

I was shocked and amazed to learn recently that that is an exception. I 
hate exceptions. But if you think about it, there is no structure for 
the compiler to be keeping to itself. This might be one for the language 
lawyers, I am just a simple application programmer.

kt

-- 

$$$$$: http://www.theoryyalgebra.com/
Cells: http://common-lisp.net/project/cells/
BSlog: http://smuglispweeny.blogspot.com/
From: Kenny
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <48a3f80e$0$20923$607ed4bc@cv.net>
>> So does this mean one should use (list nil) to create an empty list
>> instead of '()?

Uh, I just noticed that nil in there. That does not yield an empty list, 
it yields a list of length one, the element being nil:

(nil)

(list) -> '() -> nil

kt

> 
> I was shocked and amazed to learn recently that that is an exception. I 
> hate exceptions. But if you think about it, there is no structure for 
> the compiler to be keeping to itself. This might be one for the language 
> lawyers, I am just a simple application programmer.
> 
> kt
> 


-- 

$$$$$: http://www.theoryyalgebra.com/
Cells: http://common-lisp.net/project/cells/
BSlog: http://smuglispweeny.blogspot.com/
From: Pascal J. Bourguignon
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <7ctzdoeyca.fsf@pbourguignon.anevia.com>
Kenny <·········@gmail.com> writes:

>>> So does this mean one should use (list nil) to create an empty list
>>> instead of '()?
>
> Uh, I just noticed that nil in there. That does not yield an empty
> list, it yields a list of length one, the element being nil:
>
> (nil)
>
> (list) -> '() -> nil

Could we please stop with these flaky notations?  No wonder newbies are puzzled!

"a -> b"  means  the evaluation of the form a returns the object b.

(list) doesn't return a list of two symbols, QUOTE and NIL (which is
what '() is), but just the symbol NIL:

(list) -> NIL


Now, the symbol NIL can be printed and read, amongst other
representations, either as () or NIL.

C/USER[134]> (read-from-string "()")
NIL ;
2
C/USER[135]> (read-from-string "NIL")
NIL ;
3
C/USER[136]> (read-from-string "nil")
NIL ;
3
C/USER[137]> (read-from-string "cl:nil")
NIL ;
6
C/USER[138]> (read-from-string "#.(list)")
NIL ;
8
C/USER[139]> 



It also happen that NIL (the symbol) is self evaluating:

NIL -> NIL


So what you mean is that

(list) -> NIL

and:

NIL === ()



-- 
__Pascal Bourguignon__
From: Rob Warnock
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <dYCdne3uqbdKFTjVnZ2dnUVZ_rvinZ2d@speakeasy.net>
Pascal J. Bourguignon <···@informatimago.com> wrote:
+---------------
| So what you mean is that
| (list) -> NIL
| and:
| NIL === ()
+---------------

And, of course:

    (list nil) ==> (nil)      ; === (cons nil nil)


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Zach Beane
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <m3skt73gf8.fsf@unnamed.xach.com>
Kenny <·········@gmail.com> writes:

>> So does this mean one should use (list nil) to create an empty list
>> instead of '()?
>
> I was shocked and amazed to learn recently that that is an
> exception. I hate exceptions. 

In Lisp, they're not exceptions, they're conditions!

Zach
From: Rainer Joswig
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <joswig-C86B08.11111014082008@news-europe.giganews.com>
In article 
<····································@n38g2000prl.googlegroups.com>,
 Angus77 <··········@gmail.com> wrote:

> On Aug 14, 4:21�pm, Kenny <·········@gmail.com> wrote:
> > Rainer Joswig wrote:
> > > In article
> > > <····································@v1g2000pra.googlegroups.com>,
> > > �Angus77 <··········@gmail.com> wrote:
> >
> > >> Hello! �I'm certainly no Lisp expert---I'm baffled by why something
> > >> like this won't work:
> >
> > >> (defclass monkey ()
> > >> � � � � � � � ((name
> > >> � � � � � � � � :initarg :name
> > >> � � � � � � � � :accessor name)
> > >> � � � � � � � �(species
> > >> � � � � � � � � :initarg :species
> > >> � � � � � � � � :accessor species)))
> >
> > >> (defparameter gorilla (make-instance 'gorilla :name "King" :species
> > >> "gorilla"))
> > >> (defparameter chimp (make-instance 'gorilla :name "Chimpy" :species
> > >> "chimpanzee"))
> > >> (setq monkeys '(gorilla chimp))
> >
> > > Probably you wanted a list of objects and not a list of symbols?
> >
> > > (defparameter *monkeys* (list gorilla chimp))
> >
> > Ah, nice catch.
> >
> > To the OP, this is a problem with Lisp tutorials. They understandably
> > enough use things like '(1 2 3) and '(a b c) to establish lists in their
> > simple examples. Unfortunately many noobs then think one can do things
> > like this: (let ((a 1) (b 2)) '(a b)) and get back a list of 1 and 2.
> > Nope, the tick means QUOTE, which does not evaluate a and b for their
> > values.
> >
> > btw, a more common gotcha is folks then thinking they can modify lists
> > formed with quote. Those kinda belong to the compiler, you can't modify
> > those just as you should not modify C string literals.
> >
> > kt
> >
> > --
> >
> > $$$$$:http://www.theoryyalgebra.com/
> > Cells:http://common-lisp.net/project/cells/
> > BSlog:http://smuglispweeny.blogspot.com/
> 
> So does this mean one should use (list nil) to create an empty list
> instead of '()?

No.

Plus (list nil) does not create an empty list. It creates a list
with one item, the item nil.  ->   (NIL)

(list) would 'create an empty list'.  It just returns (), which is the
same as NIL.

-- 
http://lispm.dyndns.org/
From: Pascal J. Bourguignon
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <8763q4dqsu.fsf@hubble.informatimago.com>
Angus77 <··········@gmail.com> writes:

> Hello!  I'm certainly no Lisp expert---I'm baffled by why something
> like this won't work:
>
> (defclass monkey ()
>               ((name
>                 :initarg :name
>                 :accessor name)
>                (species
>                 :initarg :species
>                 :accessor species)))
>
> (defparameter gorilla (make-instance 'gorilla :name "King" :species "gorilla"))
You defined the monkey class, not the   gorilla   class.

> (defparameter chimp (make-instance 'gorilla :name "Chimpy" :species
> "chimpanzee"))

Chimps are not gorillas.  They're monkeys.


> (setq monkeys '(gorilla chimp))

Notice that here you are assigning the the variable named MONKEYS a
literal list containing two symbols named "GORILLA" and "CHIMP".

(Notice that variables are named by symbols, and symbols are named by
strings).


> (loop for x in monkeys
> 	      do (progn
> 		   (format t "~a~%" (name x))
> 		   (format t "~a~%~%" (species x))))
>
> I get this error:
>
> There is no applicable method for the generic function
>   #<STANDARD-GENERIC-FUNCTION NAME (1)>
> when called with arguments
>   (GORILLA).

You only have to understand here that (GORILLA) is the whole _list_ of
arguments.  So you called the function named NAME with one argument,
the symbol GORILLA, which is a symbol named "GORILLA".

Perhaps you could add a method such as :

(defmethod name ((self symbol)) (symbol-name self))


> even though this works:
>
> (format t "~a~%" (name gorilla))

We're at loss here.   You didn't show us the real program, so we
cannot say anything here.  


> What gives?  I'd appreciate an explanation more than a solution
> (although solutions would also be welcome!)


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

In a World without Walls and Fences, 
who needs Windows and Gates?
From: Angus77
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <248db3b2-a1de-4058-b739-05ae6c5b2fc2@v16g2000prc.googlegroups.com>
On Aug 14, 4:00 pm, ····@informatimago.com (Pascal J. Bourguignon)
wrote:
> Angus77 <··········@gmail.com> writes:
> > Hello!  I'm certainly no Lisp expert---I'm baffled by why something
> > like this won't work:
> > (defclass monkey ()
> >               ((name
> >                 :initarg :name
> >                 :accessor name)
> >                (species
> >                 :initarg :species
> >                 :accessor species)))
>
> > (defparameter gorilla (make-instance 'gorilla :name "King" :species "gorilla"))
>
> You defined the monkey class, not the   gorilla   class.

OOOPS!  That was a typo.

> > (defparameter chimp (make-instance 'gorilla :name "Chimpy" :species
> > "chimpanzee"))
>
> Chimps are not gorillas.  They're monkeys.

Another typo.  Good god...I guess I'll never get an answer if I don't
learn to ask the question right.
From: Paul Donnelly
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <87procuimf.fsf@plap.localdomain>
Angus77 <··········@gmail.com> writes:

> On Aug 14, 4:00 pm, ····@informatimago.com (Pascal J. Bourguignon)
> wrote:
>> Angus77 <··········@gmail.com> writes:
>> > Hello!  I'm certainly no Lisp expert---I'm baffled by why something
>> > like this won't work:
>> > (defclass monkey ()
>> >               ((name
>> >                 :initarg :name
>> >                 :accessor name)
>> >                (species
>> >                 :initarg :species
>> >                 :accessor species)))
>>
>> > (defparameter gorilla (make-instance 'gorilla :name "King" :species "gorilla"))
>>
>> You defined the monkey class, not the   gorilla   class.
>
> OOOPS!  That was a typo.
>
>> > (defparameter chimp (make-instance 'gorilla :name "Chimpy" :species
>> > "chimpanzee"))
>>
>> Chimps are not gorillas.  They're monkeys.
>
> Another typo.  Good god...I guess I'll never get an answer if I don't
> learn to ask the question right.

Don't feel too bad... they're apes, not monkeys.
From: Thomas A. Russ
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <ymifxp7cl1t.fsf@blackcat.isi.edu>
Warning!  Pedantry follows.


···@informatimago.com (Pascal J. Bourguignon) writes:
> 
> Chimps are not gorillas.  They're monkeys.

Actually, they aren't monkeys either.  They are apes, which is a
distinct from the (old and new world) monkeys.

-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Angus77
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <667d7916-0ee5-4c8c-b409-6f129982ad77@r15g2000prh.googlegroups.com>
On Aug 15, 7:02 am, ····@sevak.isi.edu (Thomas A. Russ) wrote:
> Warning!  Pedantry follows.
>
> ····@informatimago.com (Pascal J. Bourguignon) writes:
>
>
>
> > Chimps are not gorillas.  They're monkeys.
>
> Actually, they aren't monkeys either.  They are apes, which is a
> distinct from the (old and new world) monkeys.
>
> --
> Thomas A. Russ,  USC/Information Sciences Institute

Wow!  I never expected the answer to my question to be quite such an
education!
From: Thomas A. Russ
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <ymi1w0n6umb.fsf@blackcat.isi.edu>
Angus77 <··········@gmail.com> writes:

> On Aug 15, 7:02��am, ····@sevak.isi.edu (Thomas A. Russ) wrote:
> > Warning! ��Pedantry follows.
> >
> > ····@informatimago.com (Pascal J. Bourguignon) writes:
> >
> > > Chimps are not gorillas. ��They're monkeys.
> >
> > Actually, they aren't monkeys either. ��They are apes, which is a
> > distinct from the (old and new world) monkeys.
> >
> > --
> > Thomas A. Russ, ��USC/Information Sciences Institute
> 
> Wow!  I never expected the answer to my question to be quite such an
> education!

Well, you've then not had the chance to look at some of the more
esoteric entries in the index for Guy Steele's _Common Lisp: The
Language_ book.

It seems that caring (and knowing) about such esoterica is an old lisp
tradition. ;)

-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Pascal J. Bourguignon
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <877iaipp0m.fsf@hubble.informatimago.com>
···@sevak.isi.edu (Thomas A. Russ) writes:

> Warning!  Pedantry follows.
>
>
> ···@informatimago.com (Pascal J. Bourguignon) writes:
>> 
>> Chimps are not gorillas.  They're monkeys.
>
> Actually, they aren't monkeys either.  They are apes, which is a
> distinct from the (old and new world) monkeys.

Yes, but apes are monkeys, so technically I'm not wrong.

(Note that in French, there's only one word for both ape and monkey:
"singe"; we distinguish ape by sometime qualifying it: "grands
singes").

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Cats meow out of angst
"Thumbs! If only we had thumbs!
We could break so much!"
From: Thomas A. Russ
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <ymibpzucfq7.fsf@blackcat.isi.edu>
···@informatimago.com (Pascal J. Bourguignon) writes:

> ···@sevak.isi.edu (Thomas A. Russ) writes:
> 
> > Warning!  Pedantry follows.
> >
> >
> > ···@informatimago.com (Pascal J. Bourguignon) writes:
> >> 
> >> Chimps are not gorillas.  They're monkeys.
> >
> > Actually, they aren't monkeys either.  They are apes, which is a
> > distinct from the (old and new world) monkeys.
> 
> Yes, but apes are monkeys, so technically I'm not wrong.

Actually, the point is that apes are not monkeys, at least not in
technical English biological taxonomy.

The tree looks something like:

primates
  non-tarsir prosimians
  tarsirs, monkeys and apes
    tarsirs
    simians
      new world monkeys
      catarrhini
        old world monkeys
        apes
           gibbons
           great apes
             orangutans
             gorillas
             chimpanzees
             humans


None of the apes are children of monkeys.


-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Pascal J. Bourguignon
Subject: Re: Trying to access SLOT-VALUEs in a LOOP
Date: 
Message-ID: <877iahonw4.fsf@hubble.informatimago.com>
···@sevak.isi.edu (Thomas A. Russ) writes:

> ···@informatimago.com (Pascal J. Bourguignon) writes:
>
>> ···@sevak.isi.edu (Thomas A. Russ) writes:
>> 
>> > Warning!  Pedantry follows.
>> >
>> >
>> > ···@informatimago.com (Pascal J. Bourguignon) writes:
>> >> 
>> >> Chimps are not gorillas.  They're monkeys.
>> >
>> > Actually, they aren't monkeys either.  They are apes, which is a
>> > distinct from the (old and new world) monkeys.
>> 
>> Yes, but apes are monkeys, so technically I'm not wrong.
>
> Actually, the point is that apes are not monkeys, at least not in
> technical English biological taxonomy.
>
> The tree looks something like:
>
> primates
>   non-tarsir prosimians
>   tarsirs, monkeys and apes
>     tarsirs
>     simians
>       new world monkeys
>       catarrhini
>         old world monkeys
>         apes
>            gibbons
>            great apes
>              orangutans
>              gorillas
>              chimpanzees
>              humans
>
>
> None of the apes are children of monkeys.

Right.  I misread again the tree.  As I said, in French we've got only
one word for both branches.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Nobody can fix the economy.  Nobody can be trusted with their finger
on the button.  Nobody's perfect.  VOTE FOR NOBODY.