Forrest Curo <treegestalt@gmail.com> wroteAn array of functions, either numbered or associative? How to declare and call such an array?Since switches have so far not been included, is there a way around this?An array of Events?ChucK doesn't have function pointers or similar, so I've resorted to functors
https://github.com/heuermh/lick/blob/master/lick/fnE.g.class DoSomething extends Procedure {fun void run() { ... }}class DoSomethingElse extends Procedure {fun void run() { ... }}DoSomething doSomething;DoSomethingElse doSomethingElse;ArrayList procedures;
procedures.add(doSomething);procedures.add(doSomethingElse);while (true) {procedures.sample() $ Procedure @=> Procedure procedure;procedure.run();1::second => now;}Yeah, it ain't pretty.michael
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users