Open GoogleCodeExporter opened 9 years ago
LSL wiki says:
User-defined (global) functions cannot change a script's state. The compiler
will throw the error 'ERROR: Global functions can't change state'. Note:
Previously, global functions could change state in the body of a simple 'if'
statement; this "workaround" no longer works.
(from http://wiki.secondlife.com/wiki/State)
So it's not a issue.
Original comment by pells...@gmail.com
on 17 Apr 2014 at 6:45
That wiki remark was added on 6 june 2010. I appears to me that in practice the
LL wiki is not correct on this.
At the moment, april 2014, this 'hack' still works. Disabling it would break a
lot of existing code, so it's unlikely LL will change this in the near future
without explicit reason.
Original comment by rene.te...@gmail.com
on 17 Apr 2014 at 11:19
I remember it didn't work in beta grid before, but it seemed my misunderstanding. It worked today in main grid. And I found for, while and do while statement allow this hack. Are there any other cases?
It's very strange to inhibit state changing in function, it's not a technical problem, but this is not a place discussing it.
There are 3 points to fix it.
1. How LSLForge should work
2. How to change LSLForge compiler
3. How to change LSLForge debugger
For 1., we need to research all cases to allow state change in global
functions. (It's a troublesome task to implement such a buggy spec.)
For 2., I made some patches for LSLForge compiler but I don't understand to
show warnings yet.
And 3., I haven't read around LSLForge debugger yet, need some time to learn it.
I'm not sure when I can finish it, but not impossible.
Wait for a while...
Original comment by pells...@gmail.com
on 18 Apr 2014 at 6:45
Original issue reported on code.google.com by
rene.te...@gmail.com
on 11 Mar 2013 at 3:57