[Xotcl] Mixins in XOTcl
Michael Schlenker
schlenk at uni-oldenburg.de
Wed May 19 18:07:56 CEST 2004
Kristoffer Lawson wrote:
>On Wed, 19 May 2004, Michael Schlenker wrote:
>
>
>
>>Its similar in tcl, where you have [info commands] and not a magic
>>$commands variable as you might have in other languages.
>>
>>Using traces it should be possible to provide such an interface if
>>anyone really wants it.
>>
>>
>
>So what is so problematic about just getting a list, manipulating it and
>then setting it back? Seems like a lot of copied effort for what is
>basically just list manipulation.
>
>
Yep. I refer to Adam and Neil who both wanted to have mutable objects
instead of accessor functions.
Its the usual problem with mutable list objects and the tradional value
based list operations in Tcl.
For the typically short list of mixins and filters its mostly a
reduction of some characters to type, not more.
But i think Adam is right in his direction that it would probably more
natural to add the Mixin to the head of the list instead of the tail.
So what to do?
a) keep it as it is and use tradtional Tcl list semantics to make changes
b) add a primitive to prepend a Mixin
c) add something so the Mixin List is applied in the inverse direction,
from last to first
I think option b) isn't the right thing to do. c) is attractive but has
semantic consequences. a) is do nothing
Michael
More information about the Xotcl
mailing list