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

Re: [sc-dev] OSCFunc oneShot is breakable because of careless FunctionList implementation

On 9 Dec 2013, at 07:54, James Harkins <jamshark70@xxxxxxxxx> wrote:

"array.copy.do" would add some overhead to every FunctionList invocation. That's the safest fix, but I suppose it's worth considering the performance impact.

Hmm. Having looked at it, I think it probably does make sense, since any Function could modify the list, perhaps one you didn't add. Other options/variants:

- safe and unsafe versions of the value methods. Probably this should mean that the default versions are safe, but you have the option of the unsafe if you're worried about performance. Not sure that's common enough with FunctionList to deserve to be in Common.

- add a 'removeLater' method. This would defer removes to a cleanup stage called at the end of the value methods. We can't modify removeFunc to do this as it needs to return the modified list. The downside of this is it only works if functions play well with modifying their lists.

- add a SafeFunctionList subclass or something like that. Again not sure that deserves being in Common.

Apologies if there's a slightly cranky tone here.

Well, it is Monday morning. ;-)

I was just trying to make a plot of some amplitude curves for a class presentation, and... 30 minutes gone to chase down a random problem. I'm getting tired of /debugging/ when I should be /using/. Let's get moving on SC4, and clean up this kind of nonsense?

I somehow suspect that won't eliminate these sorts of cases, but I like the optimism. :-)