The most obvious implementation would be to have a non global variable, as identifier to the singleton Negator class whose ::- method would take a single topicargument and return !topic. But of course in Ruby, naming a global variable non won't be possible, the closest achievable thing that can be implemented are to use $non as identifier, or create a non method on Kernel or BasicObject that would return Negator.
Strict here would especially mean "must respect the same precedence", unlike for example the
not
operator:So the expected implementation would allow the following:
The most obvious implementation would be to have a
non
global variable, as identifier to the singletonNegator
class whose::-
method would take a singletopic
argument and return!topic
. But of course in Ruby, naming a global variablenon
won't be possible, the closest achievable thing that can be implemented are to use$non
as identifier, or create anon
method onKernel
orBasicObject
that would returnNegator
.