About the nom negation operator !
The nom language uses the fairly standard bang operator “!” as a negation operator. This can be put before all types of tests, such as class tests (eg [:space:] ), text-is tests (eg “abc"), begins-with tests (eg: B” abc") ends-with tests (eg: E"abc") etc.
In SED the negation operator goes after the test it is modifying, but in ℕ𝕠𝕞 the negation operator goes before
read;
[:space:] { clear; .restart }
[:alnum:] {
while [:alnum:]; put;
clear; add "word*"; push; .reparse
}
parse>
!"" {
put; clear;
add "! Incorrect character '"; get; add "'\n";
add "! (only alpha-numeric allowed) \n";
print; quit;
}
The idiom above is a simple way to determine if there is a character or characters in the input-steam which is acceptable in the current language. This snippet normal goes just before the parse> label after all other characters and strings have been tokenised.
!"" {
put; clear;
add "! Incorrect character '"; get; add "'\n";
print; quit;
}
Double negation (!!) is not permitted because it is fairly semantically useless, and the same applies to triple, quadruple etc negation.
while
and
whilenot
commands