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:48:38 +0200 (EET)

On Fri, 24 Jan 2003, Gustaf Neumann wrote:

>
> The caller can certainly do with the object whatever she wants.
> if these are properties needed in the creation method they
> have to be passed somehow there, or the object can be altered,
> or one can put a mechanism on top of the creation to handle this.
> I personally would not have a problem in using two different method
> names for the different cases, like
> set msg [$cmdReader getMessage]
> set msg [$cmdReader getNewMessage]
> or to use an option like in
> set msg [$cmdReader getMessage -volatile]

But that doesn't solve the issue. $cmdReader cannot create the object
itself as volatile or bound to a variable as it will then be destroyed the
minute getNewMessage returns! Or, of course it could always use uplevel
and upvar but then every method that wants to return an object that may or
may not be bound to a variable has to provide this extra functionality and
argument checking. Ie. the methods need to be concerned with what the
caller wants, and I don't believe this is necessary a good thing.

Again, I'm not saying this feature is absolutely essential, but if one
decides to add it I believe it should be done in the best possible way ;-)

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