From: André Thieme
Subject: What is an object?
Date: 
Message-ID: <ccffhe$5k5$1@ulric.tng.de>
The HyperSpec explains that there are two meanings for "object".
The second one is the same like in other languages that support oop.
But could you please give me another definition of the first meaning? 
Please add some examples. What is "any Lisp datum"?
It can't be the instance of a type cause this would be the second 
meaning of "object".

I regard this as extremly important and it must be 100% sure because in 
hundreds of definitions in the HyperSpec this word is used to explain 
other words. That way I want to make sure that I absolutely understand it.


Andr�
--

From: Paul F. Dietz
Subject: Re: What is an object?
Date: 
Message-ID: <-8mdnTEoZJhc3nbdRVn-vg@dls.net>
Andr� Thieme wrote:
> The HyperSpec explains that there are two meanings for "object".
> The second one is the same like in other languages that support oop.
> But could you please give me another definition of the first meaning? 
> Please add some examples. What is "any Lisp datum"?
> It can't be the instance of a type cause this would be the second 
> meaning of "object".

No, the second definition explains what the phrase 'object of type foo'
means.

'Any lisp datum' is the union of the second definition, taken over all types.

	Paul
From: André Thieme
Subject: Re: What is an object?
Date: 
Message-ID: <ccfg70$61k$1@ulric.tng.de>
Paul F. Dietz schrieb:

> Andr� Thieme wrote:
> 
>> The HyperSpec explains that there are two meanings for "object".
>> The second one is the same like in other languages that support oop.
>> But could you please give me another definition of the first meaning? 
>> Please add some examples. What is "any Lisp datum"?
>> It can't be the instance of a type cause this would be the second 
>> meaning of "object".
> 
> 
> No, the second definition explains what the phrase 'object of type foo'
> means.
> 
> 'Any lisp datum' is the union of the second definition, taken over all 
> types.

So an object is the instance of some data type.


Andr�
--
From: Paul F. Dietz
Subject: Re: What is an object?
Date: 
Message-ID: <S8idnfQLGdXm1XbdRVn-ug@dls.net>
Andr� Thieme wrote:

> So an object is the instance of some data type.

Each object is an instance of many different data types, actually.
Each object is a direct instance of only one class, however.

	Paul
From: Joe Marshall
Subject: Re: What is an object?
Date: 
Message-ID: <d638x872.fsf@ccs.neu.edu>
Andr� Thieme <······························@justmail.de> writes:

> The HyperSpec explains that there are two meanings for "object".
> The second one is the same like in other languages that support oop.
> But could you please give me another definition of the first meaning?
> Please add some examples. What is "any Lisp datum"?

Anything that can be stored in an array, printed, be returned as a
value from a function, be passed as an argument to a function,
assigned to a variable, etc.  This includes (but is not limited to)
things like numbers, symbols, cons cells (and by extension lists),
arrays (and by extension strings), hash tables, CLOS instances,
functions (and closures), readtables, packages, etc. etc.

There are things that are frequently talked about that are *not*
objects, e.g., a binding, a transfer of control, the stack, the
garbage collector.  These are concepts and data structures that are
used to implement Lisp, but aren't directly accessible to the
programmer.
From: Pascal Costanza
Subject: Re: What is an object?
Date: 
Message-ID: <ccgtrh$qag$1@f1node01.rhrz.uni-bonn.de>
Joe Marshall wrote:

> Andr� Thieme <······························@justmail.de> writes:
> 
>>The HyperSpec explains that there are two meanings for "object".
>>The second one is the same like in other languages that support oop.
>>But could you please give me another definition of the first meaning?
>>Please add some examples. What is "any Lisp datum"?
> 
> Anything that can be stored in an array, printed, be returned as a
> value from a function, be passed as an argument to a function,
> assigned to a variable, etc.  This includes (but is not limited to)
> things like numbers, symbols, cons cells (and by extension lists),
> arrays (and by extension strings), hash tables, CLOS instances,
> functions (and closures), readtables, packages, etc. etc.
> 
> There are things that are frequently talked about that are *not*
> objects, e.g., a binding, a transfer of control, the stack, the
> garbage collector.  These are concepts and data structures that are
> used to implement Lisp, but aren't directly accessible to the
> programmer.

As an additional remark, you sometimes hear people talk about 
"first-class this" and "first-class that", for example "first-class 
functions". The term "first-class" refers exactly to the things that you 
can store, return, pass around, etc. - the things that Joe describes in 
his first paragraph. The others are not first-class.


Pascal

-- 
Pascal Costanza               University of Bonn
···············@web.de        Institute of Computer Science III
http://www.pascalcostanza.de  R�merstr. 164, D-53117 Bonn (Germany)
From: André Thieme
Subject: Re: What is an object?
Date: 
Message-ID: <cchh66$v52$1@ulric.tng.de>
Pascal Costanza schrieb:
> Joe Marshall wrote:
> 
>> Andr� Thieme <······························@justmail.de> writes:
>>
>>> The HyperSpec explains that there are two meanings for "object".
>>> The second one is the same like in other languages that support oop.
>>> But could you please give me another definition of the first meaning?
>>> Please add some examples. What is "any Lisp datum"?
>>
>>
>> Anything that can be stored in an array, printed, be returned as a
>> value from a function, be passed as an argument to a function,
>> assigned to a variable, etc.  This includes (but is not limited to)
>> things like numbers, symbols, cons cells (and by extension lists),
>> arrays (and by extension strings), hash tables, CLOS instances,
>> functions (and closures), readtables, packages, etc. etc.
>>
>> There are things that are frequently talked about that are *not*
>> objects, e.g., a binding, a transfer of control, the stack, the
>> garbage collector.  These are concepts and data structures that are
>> used to implement Lisp, but aren't directly accessible to the
>> programmer.
> 
> 
> As an additional remark, you sometimes hear people talk about 
> "first-class this" and "first-class that", for example "first-class 
> functions". The term "first-class" refers exactly to the things that you 
> can store, return, pass around, etc. - the things that Joe describes in 
> his first paragraph. The others are not first-class.


Yes.. in Python for example a class is a first class object. While in 
C++ a class is only a declaration and does not consume any memory this 
is different in Python. You can pass a class (the class itself, not only 
instances) around.


Andr�
--
From: Edi Weitz
Subject: Re: What is an object?
Date: 
Message-ID: <87eknn4f2n.fsf@bird.agharta.de>
On Wed, 07 Jul 2004 20:59:47 +0200, Andr� Thieme <······························@justmail.de> wrote:

> Yes.. in Python for example a class is a first class object. While
> in C++ a class is only a declaration and does not consume any memory
> this is different in Python. You can pass a class (the class itself,
> not only instances) around.

Same in Lisp:

  * (defclass a () ())

  #<STANDARD-CLASS A {4802799D}>
  * (make-instance 'a)

  #<A {4802A0CD}>
  * (class-of *)

  #<STANDARD-CLASS A {4802799D}>
  * (describe *)

  #<STANDARD-CLASS A {4802799D}> is a structure of type STANDARD-CLASS.
  CLASS-INFO: #<TYPE-CLASS CLASS>.
  ENUMERABLE: NIL.
  NAME: A.
  LAYOUT: #<Wrapper #<Standard-Class A {48026BB5}> {480279C5}>.
  STATE: NIL.
  DIRECT-SUPERCLASSES: NIL.
  SUBCLASSES: NIL.
  PCL-CLASS: #<Standard-Class A {48026BB5}>.
  * (class-name **)

  A

And so on...

Edi.

-- 

"Lisp doesn't look any deader than usual to me."
(David Thornley, reply to a question older than most languages)

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Mark McConnell
Subject: Re: What is an object?
Date: 
Message-ID: <d3aed052.0407070847.6ac4d819@posting.google.com>
Andr� Thieme <······························@justmail.de> wrote in message news:<············@ulric.tng.de>...
> The HyperSpec explains that there are two meanings for "object".
> The second one is the same like in other languages that support oop.
> But could you please give me another definition of the first meaning? 
> Please add some examples. What is "any Lisp datum"?

I think you read this page of the HyperSpec, or one like it.

http://www-2.cs.cmu.edu/Groups/AI/html/hyperspec/HyperSpec/Body/glo_o.html

On that page, definition 2 is just a detail.  It says that since
functions are objects too, we sometimes have to say the phrase
"function object".  For instance,
(defun double (x) (* 2 x))
creates a function object.  When we write
(double 3) ==> 6
there is a function object working behind the scenes to "do" the
doubling.

The real definition of "object" is 1, "any Lisp datum".  For instance,
the following are Lisp objects:

3 ;; a number object
;; In Java, int's are not Objects, but they're limited to 32 bits.
;; If you want really big integers, you use java.math.BigInteger,
;; which is an Object.  In Lisp, they're all objects.

cow ;; a symbol object

#'(lambda (x) (* 3 x)) ;; a function object that does tripling

(make-array 10) ;; an array object

(list 1 2 3) ;; a list object

(make-instance 'animal :species 'horse)
;; An object that's an instance of a CLOS class.
;; If you're thinking of C++ or Java, you may
;; be wondering if these are the only objects,
;; but no--all the previous ones are, too.

plus hash-tables, streams, and many others.
From: Gareth McCaughan
Subject: Re: What is an object?
Date: 
Message-ID: <87k6xgdtfw.fsf@g.mccaughan.ntlworld.com>
···@zedat.fu-berlin.de (Stefan Ram) writes:

> Andr� Thieme  <······························@justmail.de> writes:
>> The HyperSpec explains that there are two meanings for "object".
>> The second one is the same like in other languages that support oop.
>> But could you please give me another definition of the first meaning? 
>  
>   I have not read the document you refer to, but a natural
>   definition of "object" (not in the OOP sense) in LISP would
>   be: "An object is either an atom or a list (cons, nil)."

Ouch. Please, no. That perpetuates the long-outdated idea
that in Lisp's type system there's something Really Special
about lists. That was true back in the 1960s, but it certainly
isn't true about present-day Common Lisp. Anyway, defining
"atom" is then exactly as hard as defining "object" was before;
you'd then have to say "An atom is an object that is not a
list". :-)

-- 
Gareth McCaughan
.sig under construc