S x;
L F = x;
$x = x;
if (occurs($x));
P "Found: %t";
endif;
.end
which currently give a compilation error. Of course when a content of the $-variable is illegal for the parameter of occurs, e.g., an expression 1+x, a runtime error should occur. For now a workaround woube be (assuming $x is always a symbol):
S x,TMP;
L F = x;
$x = x;
multiply replace_($x,TMP);
if (occurs(TMP));
multiply replace_(TMP,$x);
P "Found: %t";
else;
multiply replace_(TMP,$x);
endif;
.end
It would be nice if one can write like
which currently give a compilation error. Of course when a content of the $-variable is illegal for the parameter of
occurs
, e.g., an expression1+x
, a runtime error should occur. For now a workaround woube be (assuming$x
is always a symbol):