Is it possible to have a non-positional argument that is optional and its variable is only set when it is present as the argument to the method. Otherwise, it is ignored, no error. Basically, I want it behave like an option to the method but without specifying any value. Example:
myobj method m {-test} { if {[info exists test]} { puts "test exists"; } else { puts "test does not exist"; }
myobj m;#test does not exist myobj m -test;#test exists
Or, it can even be a boolean, set to 1 if it was specified and set to 0 if not. That would be even better, shorter code.
Thank you