"RokuKevin" wrote:
Mark,
Yes, the current behavior is that the only time 'm' will be set is when the method is explicitly called with the dot operator. I suggest not relying on this behavior in any of your code, as we will continue to expand BrightScript's capabilities in the future. Including dynamic dispatch, closures, etc... could reasonably make the cut at some point.
Your eval() technique above is probably a reasonable work-around for the time being in scenarios like unit-test frameworks.
--Kevin
Kevin,
Thanks for the response. I've started using the eval() technique for the time being.
When you say not to rely on the behavior do you mean the dot operator/'m' variable in general (as I'm using it quite a bit currently)? Or do you mean the distinction of when the 'm' variable is set or not?
Also, I'm VERY happy to hear that there's a possibility to include closures. I was disappointed when I realized the first time I used anoymous function to find that I couldn't close over variables in the containing scope.
-Mark