Under review

TracePoints editor could warn if sid`e-effects in evaluation

MBR 4 years ago updated by Lior Kerner 4 years ago 1

I was seeing really strange behavior in my program until I found that I had selected too much text when I created by tracepoint eval text and had included "var--" rather than just "var" -- every time it hit the tracepoint, it decremented by variable.

It may be useful if OzCode detected if an expression was not "pure" (could cause side effects -- modifying an lvalue directly, or calling any function, assuming it may be impure) and warned the user "Warning: This trace expression (modifies | may modify) the state of your program".

Under review

Hi and thanks for the idea!

This might be a bit complicated to implement, since it's difficult to notice, when calling a method, whether it caused side effects. In these cases (++ or -- or assignment) it might be worthy to have some sort of warning - we'll consider this.