"siekermantechnology" wrote:
In SceneGraph the closest thing I could think of would be to create a custom component of which you store an instance in m.global. It's not exactly the same thing, but it is possible to get close to what you would want to achieve.
Nope.
You can't!The answer is simple: there is no <censored/> way to share
functions between RSG threads.
Which is really ironic - because if there is one thing that Brightscript should be better for multithreading than other languages, it's the lack of function scope^ - meaning there is no principal problem in sharing functions between threads (main v. render v. tasks) since functions are semanthicly constant/literals and thus no thread locks will be needed on invocation! In other words, there is no reason whatsoever why there could not be "function singletons".
Moreover, RSG simply does not support function fields! It does not now, nor will it in the coming rOS 7.5 - and from the looks of it, they have no intent to!
"Bless the Maker and His water!"
I have asked for it, i have advocated for it in this forum... no reply. I talked 1:1 to couple of the dev.relators (realtors?) - but they did not relate. I
am afraid they did not understand the issue/need. Particularly the scoping advantage of B/S i know went a total "whoosh!".(^) no lexical nor nor dynamic scope, no closures. Yes, you have the "m" (self/this) but that is set as part of invocation