View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] "tie" command

From: Kristoffer Lawson <setok_at_fishpool.com>
Date: Fri, 24 Jan 2003 18:03:45 +0200 (EET)

On Fri, 24 Jan 2003, Gustaf Neumann wrote:

> > Oh, I meant to say that an option to [new] is not necessarily the best.
> > Often (at least in my case) it is a method of an object which creates
> > an instance and returns it, like:
> >
> > set msg [$cmdReader getNewMessage]
> >
> > So at the level where I want the automisation I don't directly call new.
> > Naturally this could be changed to accommodate the use of new, but then
> > my interface wouldn't be as cleanly split up.
>
> i don't get your point: getNewMessage has to create the Object,
> so it can use certainly new (with all variants). is your argument:
> the caller of newmessage should decide, whether the created
> object should be dynamically reclaimed or not?

Yes, obviously getNewMessage will use [new], but it wont be using [new
-bind] for obvious reasons! The caller is the one that wants to bind it to
a variable, so yes my argument is that the caller should decide. In fact,
it could be argued that the same applies to -volatile. That there are
cases when a new object should be returned by some method other than [new]
but the caller is generally the one that wants to decide the dynamics of
the object.

                              / http://www.fishpool.com/~setok/