REQUEST
Add a new NOP instruction to do nothing.
Possible syntax: NOP, DO NOTHING, NOTHING.
RATIONALE
In various occasions I've come across the need of a NOP instructions, e.g. when I'm forced to rely on the ELSE part of a condition containing an expression that can't be NOT-evaluated, or because I needed a temporary placeholder while drafting some code changes.
As a practical example, class expression can only be positively evaluated, so it's not possible to use If X NOT IsA someclass (e.g. when trying to affect only instances of the ancestor class, when targeting an attribute that is inherited along the line).
The closest thing to a NOP right now is printing an empty string, but this is not possible inside RULEs:
WHEN location OF hero IS lit
THEN
IF location OF hero IsA cave
THEN "" -- do nothing! (doesn't work)
ELSE
-- Whatever needs to be done on `lit` locations that
-- are not cave instances...
The above example (possibly not 100% correct) roughly illustrates where a NOP instruction would be useful.
Hopefully, implementing a NOP shouldn't be too complex, nor have unexpected side effects (since it does nothing), and wouldn't affect backward compatibility.
REQUEST
Add a new NOP instruction to do nothing.
Possible syntax:
NOP,DO NOTHING,NOTHING.RATIONALE
In various occasions I've come across the need of a NOP instructions, e.g. when I'm forced to rely on the
ELSEpart of a condition containing an expression that can't beNOT-evaluated, or because I needed a temporary placeholder while drafting some code changes.As a practical example, class expression can only be positively evaluated, so it's not possible to use
If X NOT IsA someclass(e.g. when trying to affect only instances of the ancestor class, when targeting an attribute that is inherited along the line).The closest thing to a NOP right now is printing an empty string, but this is not possible inside RULEs:
The above example (possibly not 100% correct) roughly illustrates where a NOP instruction would be useful.
Hopefully, implementing a NOP shouldn't be too complex, nor have unexpected side effects (since it does nothing), and wouldn't affect backward compatibility.