Does Spin have a fixed rule for evaluation order ? I have found the table of operator precedence, but sometimes it matters what order the expression is evaluated in.
e.g. in C,
if ((x = fn1(y) && fn2(x))
the language guarantees that fn1(y) will be evaluated before fn2(x) and that fn2(x) will not be evaluated at all if x turns out to be zero. This is quite handy as the equivalent nested statements result in two elses, not the single statement above.
When I did something similar in Spin, I had results which indicated that fn2 was being evaluated regardless of the result of fn1, and possibly with an uninitialized argument. This would not be surprising if Spin actually converts the expression to a stack representation and then evaluates it, which would be a fairly normal approach for a tokenised language.
So in retrospect, it's not that surprising that it didn't work (and since the argument was the address of a location to write in eeprom, ended up corrupting my program code ..) but if the behaviour is specified I'd like to read the rest of the rules.