Re: How does xotcl compare to ruby?
- From: "GN" <neumann@xxxxxxxxxxxxx>
- Date: 28 Sep 2006 01:11:17 -0700
Donal K. Fellows schrieb:
GN wrote:
What is "object cloning"? is it like the copy method in xotcl (deep
copy) or something different?
Hmm, I'm not 100% sure how it differs. It creates a new object that is a
duplicate of the old one, but does not copy the underlying namespace,
mostly because there's no simple call to do that at the moment. (The
code has no idea about sub-objects, so naturally doesn't try to copy
them.
ok, this means, if an object has child objects, it does not copy it,
and the clone ooeration does not copy any object specific behavior. The
copy operation of XOTcl does both (including namespace, if necessary).
The XOTcl users would be quite unhappy, if it did not.
No idea if that's part of what you call "deep copy" though.)
A "deep copy" is a "copy operation" where an object is copied with the
objects it contains. The notion, what "contains" means, differs from
the aggregation semantics (see e.g. the UML concepts association,
aggregation and composition) of the application and language.
A "shallow copy" is a "copy operation", where the contained objects of
the source are not
copied, but shared between the objects; this is the place where storage
management and
deletion semantics kick in, since when the source object is deleted,
the target object should
most likely not be affected. This requires reference counting and the
like.
Java for example contains a clone() operation that performs per default
(as defined on the most general superclass Object) a shallow copy. This
is highly related with javas garbage collection.
What you describe as "clone" does not appear to be deep or shallow
("no idea about sub-objects"). Btw, what does it exactly copy? The tip
as i have read it does not mention "clone" at all.
What's from Snit and Incr Tcl?
Lots of design stuff. It's a while since Will Duquette and I designed
the API so I forget exactly which bits came from where.
Is this a political statement about itcl or something substantial? The
differences between XOTcl and itcl are not a question of the API, but
about design. Some of he design concepts are quite contrary. Are there
any concepts specific to itcl part of what you have implemented?
Donal.
.
- Follow-Ups:
- Re: How does xotcl compare to ruby?
- From: Donal K. Fellows
- Re: How does xotcl compare to ruby?
- References:
- How does xotcl compare to ruby?
- From: casioculture
- Re: How does xotcl compare to ruby?
- From: Larry W. Virden
- Re: How does xotcl compare to ruby?
- From: Donal K. Fellows
- Re: How does xotcl compare to ruby?
- From: GN
- Re: How does xotcl compare to ruby?
- From: Donal K. Fellows
- How does xotcl compare to ruby?
- Prev by Date: Re: Why no central repository for tcl extensions?
- Next by Date: Re: TIP #86 (was Re: Debug API in the core?)
- Previous by thread: Re: How does xotcl compare to ruby?
- Next by thread: Re: How does xotcl compare to ruby?
- Index(es):
Relevant Pages
|