[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] arrays of (changing) functions



hi,

I'm trying to change functions on the fly that works great when I create
them explicitly but trying to use arrays of functions I have to reevaluate
the whole collect statement to get it to work why is that ?

// this is pretty much what I want, and that works:
~f1 = nil;      // nothing
~t1 = {~f1.()}; // works
~t1.();         // test -> ok
~f1 = { "f1".postln; }  // change
~t1.(); // test -> ok ~f1 = { "f1a".postln; } // etc ....
~t1.();
~f2 = { "f2".postln; }
~t1 = {~f2.()};
~t1.();
// but arrays of functions don't:
~f3 = nil;
~fs = [~f1,~f3];
~t1 = { ~fs[0].() };  // still
~t1.();               // works
~f3 = { "f3".postln;} ~t1 = { ~fs[1].() }; // this
~t1.();               // doesn't

is there a simple solution without reevaluating the array and re-collect it ?

TIA,
x

--
chris@xxxxxxxxxx        Postmodernism is german romanticism with better
http://pilot.fm/        special effects. (Jeff Keuss / via ctheory.net)

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/