Hello Lispers,
I'm studying lisp and more and more like it.
Anyway, can anybody let me know what the following responses from Lisp
Listener?
(eq 'content-length 'content-length) => T
(eq 'content-length (intern "content-length")) => NIL
(eql 'content-length (intern "content-length")) => NIL
(equal 'content-length (intern "content-length")) => NIL
Thanks in advance.
--
Chung jae youn
··········@pllab.kaist.ac.kr
http://pllab.kaist.ac.kr/~jay
In article <···············@bronze.kaist.ac.kr> , Chung jae youn
<···@pllab.kaist.ac.kr> wrote:
>
>Hello Lispers,
>I'm studying lisp and more and more like it.
>
>Anyway, can anybody let me know what the following responses from Lisp
>Listener?
>
> (eq 'content-length 'content-length) => T
> (eq 'content-length (intern "content-length")) => NIL
> (eql 'content-length (intern "content-length")) => NIL
> (equal 'content-length (intern "content-length")) => NIL
>
eq checks for identical objects. The other equality comparisons do extra
work, but default to eq for symbols.
(intern "content-length") is not eq to (intern "CONTENT-LENGTH"); these
return two distinct symbols, named |content-length| and CONTENT-LENGTH.
Have a look at the HyperSpec at
<http://www.harlequin.com/education/books/HyperSpec/>, especially chapters
10 and 11.
---
David B. Lamkins <http://www.teleport.com/~dlamkins/>