[Xotcl] new feature idea

vitick at gmail.com vitick at gmail.com
Wed Sep 29 20:28:16 CEST 2010


It occurred to me that XOTcl could benefit or it's "coolness" value could be raised even more if it had method chaining similar to JQuery. Example:

Class create Myclass

Myclass :method a args {
   process {*}$args;
}

Myclass :method b args {
   process {*}$args;
}


Myclass create myobj

execute:

myobj :chain :a :b {value1 value2}

or:

myobj :chain :a :b :a :b :destroy {value1 value2}

################
syntax: 

obj :chain :method1 :method2 .... {arg1 arg2 ...}

################
functionality:

each method would be executed in the order listed with the args provided in the end of the "chain" method. 
################

This functionality is even more enhanced with mixins and superclasses where each chained method would be passed to a mixin/superclass via [next]. 


P.S. this is not really a feature request at the moment because I see you are very busy doing a lot of work on Next. And that has more priority. Also, the "chain" functionality can be easily done via scripting it myself. Again, for the "coolness" or "extra power" value, it would be nice to have that, in my opinion, as a built-in feature.   



More information about the Xotcl mailing list