Re: What do we mean by "Identical" ?
- From: "John Thingstad" <john.thingstad@xxxxxxxxx>
- Date: Sun, 30 Oct 2005 19:01:02 +0100
On Sun, 30 Oct 2005 17:49:16 +0100, Pascal Bourguignon <spam@xxxxxxxxxxxxxxxx> wrote:
"John Thingstad" <john.thingstad@xxxxxxxxx> writes:Also NIL is the ONLY object that does not inherit from T.
What do you mean?
An object may be an instance of a class. A class may inherit from another class.
But unless we have an object model where the dichotomy between objects and classes doesn't exist, an object doesn't inherit from another object.
That said in CL, T is a "class", and NIL is an instance of (a subclass of) the class T:
(typep NIL 'T) --> T
#+clisp (clos::subclassp (find-class 'null) (find-class 't)) --> T
So.. any expression that does not evaluate to nil is T in Lisp generalized boolean.
It is not T, it is true.
(if 1 ..) gives the same result as (if 2 ...) or (if "hello" ...) Expressions on the form nil, T, some number, a string are called self evaluating. That is.. When 'called' during the parsing of the paramenters they return themselves. Also a function call (func ..) is T unless it returns nil.
Not T, true.
Sorry, strike inherit. Make that 'The ONLY object that dosn't evaluate to true'.
Inheritance is irrelevant in the context anyhow.
The seperate type system and class system make me a bit nuts sometimes.
(By the way Pacal mentioned that eq != eql only for numbers and chars. As far as I can see it holds for strings and bitvectors too.. look up equal in CLHS)
Anyhow for a beginner eql (elements same type and value) and equal (elements isomorphic) seem sufficient.
well, also string=, char=, =
-- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ .
- References:
- What do we mean by "Identical" ?
- From: newser . bbs
- Re: What do we mean by "Identical" ?
- From: newser . bbs
- Re: What do we mean by "Identical" ?
- From: newser . bbs
- Re: What do we mean by "Identical" ?
- From: Harald Hanche-Olsen
- Re: What do we mean by "Identical" ?
- From: newser . bbs
- Re: What do we mean by "Identical" ?
- From: John Thingstad
- Re: What do we mean by "Identical" ?
- From: Pascal Bourguignon
- What do we mean by "Identical" ?
- Prev by Date: http://wikihost.org/wikis/lisplogogreate/
- Next by Date: Re: htmlgen ignores function return value
- Previous by thread: Re: What do we mean by "Identical" ?
- Next by thread: Re: What do we mean by "Identical" ?
- Index(es):
Relevant Pages
|