Re: How does xotcl compare to ruby?



GN wrote:
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.

It copies object-specific methods (which are not procedures for various
reasons, though they use a common core with procedures and lambda terms)
but leaves the variables alone. Perhaps this should change; feedback
from the community will definitely help refine this part.

No idea if that's part of what you call "deep copy" though.)
[discussion elided; I knew the UML concepts but not how they applied to XOTcl]
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.

It's currently not a method at all (instead, it's an operation supported
through [oo::define]) but there is no copying of namespaces because it
is not at all clear what that means. Some things are mostly easy (e.g.
the copying of a procedure) but how do you copy a variable with traces
or a command that is implemented in C? When you've got sub-objects, is
it right to clone those or use some kind of reference so that they are
shared?

I don't have the answers to those questions, but given the complexity of
doing a total clone, I've decided to leave the copying of the namespace
to third-party code. That can define what behaviour it wants; I just
provide the support code that lets the object core be cloned. (And
thanks for explaining; you do far more than I attempt in this area.)

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?

It's a reflection of the fact that I don't remember. It happens. :-)
Will and I passed the design document back and forth quite a few times,
and working out who did what where when and why would now be a tricky
little research project.

However, I'd say that there are many more genes from XOTcl in my code
than there are from iTcl. The majority of differences are due to the
fact that we altered how objects are created and initialized; the XOTcl
way doesn't gel nicely with our other critical design goals, and a great
deal of things are consequent upon that (enough that we couldn't start
from the XOTcl code-base; I spent several months learning that).

The other thing I'd love some help with is the fine details of class
mixins in XOTcl. What is the use-case for the feature? Are class-mixins
designated by mixed in classes processed? (If so, how can you ground the
whole process?!) I ask because right now I've not implemented them on
the grounds that I don't understand them enough. :-)

Donal.
.



Relevant Pages

  • TIP #257: Object Orientation for Tcl
    ... designed specifically to allow classic XOTcl to be built on top. ... the time has come for the core to provide OO support. ... definition is to be moved to a separate utility command, ... every class and every object has an associated namespace. ...
    (comp.lang.tcl)
  • [Fwd: TIP #257: Object Orientation for Tcl]
    ... designed specifically to allow classic XOTcl to be built on top. ... the time has come for the core to provide OO support. ... definition is to be moved to a separate utility command, ... every class and every object has an associated namespace. ...
    (comp.lang.tcl)
  • Re: OO in 8.5! Re: TIP #257: Object Orientation for Tcl
    ... Part of the effort in "redesigning" xotcl for what the core really needs is to hopefully address this. ... you might have as well noticed, that oo gets it own namespace in the tip. ... There are already many systems, that implement oo-style functionalities on the tcl layer, so providing this functionality in a c-based oo framework would help to save memory and to speed things up. ... won't be forced on users, some users have very valid reasons to worry about bloat, based on their use of Tcl. ...
    (comp.lang.tcl)
  • XOTcl and Namespace
    ... Test instproc init {args} { ... but I destroyd object t6 ... Does xotcl don't write in the namespace from the object, if the namespace is used before the creation of the object? ...
    (comp.lang.tcl)
  • Re: xotcl nested namespaces/objects
    ... Now XOTcl object do not create namespace for performance ... Memory per xotcl object: 275 ... % Class RequireAlwaysNamespaces ...
    (comp.lang.tcl)