Re: What do we mean by "Identical" ?



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/
.



Relevant Pages

  • Re: Some newbie questions
    ... inherit from DataSet, DataSets inherit from Object if you go far enough up ... > To my suprise was the datacolumn indexer the fastest. ... --I'd expect the string to be the slowest but the indexer part is what's ...
    (microsoft.public.dotnet.framework.adonet)
  • setting property value erors in serviced components
    ... when I inherit the class from the ... ByVal sigortalituru As String, ByVal karneno As Integer, ByVal pgmid As ... ByVal unitekod As Integer, ByVal kaydet As Boolean) As ObjectImplements ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Implement a Case INsensitive string.Comtains method?
    ... The proper .NET way is to write a custom string class ... As far as inheriting goes, you shouldn't need to inherit any class. ... you can write an extension method for   ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Implement a Case INsensitive string.Comtains method?
    ... The proper .NET way is to write a custom string class ... As far as inheriting goes, you shouldn't need to inherit any class. ... missing a reference to System.Core.dll. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Detecting type of object
    ... that work like strings but inherit from a user-defined prototype object ... you need to test against the `String' of the same frame, ... It's a relatively painless remedy to the deficiencies of `typeof`, `instanceof`, etc. that you mention (mainly, frame issue and an unreliable runtime nature of `instanceof`). ...
    (comp.lang.javascript)