copy yourself ?

Richard A. O'Keefe ok at cs.otago.ac.nz
Thu May 22 23:53:31 UTC 2003


"jan ziak" <ziakjan at host.sk> wrote:
	i would like to ask whether some squeaker has ever seen an
	object which is capable of copying itself.

Why is that an interesting question?  I have never seen a physical object
that could add 1 to itself either.  Smalltalk objects are not, for the
most part, simulations of physical objects and there is no reason why
they should go out of their way to imitate the limitations of physical
objects.

	the point is that i do not
	believe that any object could copy itself.

Von Neumann proved that it could.

	so why, in smalltalk, almost every object can copy itself when i
	send a message to it - it seems absurd to me.  doesn't it also
	to you?

Not in the least.  Smalltalk objects can copy themselves because it
is *useful* for them to be able to copy themselves.  There isn't the
slightest absurdity in being useful.  On the contrary, what is
EXTREMELY absurd is beating Smalltalk over the head because it has
computational objects rather than physical objects.

	a second problem is that the copying process depends on
	particularities of situation in which someone or something
	want's to copy an object.  copying is context dependent.  so why
	has every object in smalltalk only one method for copying (well
	it has three types of copy-methods but the point is that the
	number and meaning of them fixed).

Neither the number nor the meaning of copying methods is fixed.
Any method can be overridden, and copying methods very often are.
If you want to add a new #copyImprecisely method to Object,
there isn't anything at all in Smalltalk to stop you.

In short, the number and semantics of copying methods is whatever you
want it to be.

	wouldn't it be more rational to have objects capable of
	constructing copies of objects?
	
Clumsier, yes.  More rational?  In what conceivable way?

One more time:
    COMPUTATIONAL OBJECTS ARE NOT PHYSICAL OBJECTS
    AND SHARE NEITHER THEIR STRENGTHS NOR THEIR LIMITATIONS.
    It is irrational to blame them for being different.
	



More information about the Squeak-dev mailing list