Index: library/nx/plain-object-method.tcl =================================================================== diff -u -N -rf93a2f18571f5f0fe266cd26299f463d55f0ac2d -r199e95f5c3774fc56dfb85a47f99c0b8141bf29e --- library/nx/plain-object-method.tcl (.../plain-object-method.tcl) (revision f93a2f18571f5f0fe266cd26299f463d55f0ac2d) +++ library/nx/plain-object-method.tcl (.../plain-object-method.tcl) (revision 199e95f5c3774fc56dfb85a47f99c0b8141bf29e) @@ -2,55 +2,51 @@ namespace eval ::nx { - nx::Object eval { - - :public method method { - name arguments:parameter,0..* -returns body -precondition -postcondition - } { - ::nsf::log warn "LEGACY CMD: [self] [current method] [current args]" - :public object [current method] {*}[current args] + # + # Define a method to allow configuration for tracing of the + # convenience methods. Use + # + # nx::configure plain-object-method-warning on|off + # + # for activation/deactivation of tracing + # + nx::configure public object method plain-object-method-warning {onoff:boolean,optional} { + if {[info exists onoff]} { + set :plain-object-method-warning $onoff + } else { + if {[info exists :plain-object-method-warning]} { + if {${:plain-object-method-warning}} { + uplevel {::nsf::log warn "plain object method: [self] [current method] [current args]"} + } + } } + } - :public method alias args { - ::nsf::log warn "LEGACY CMD: [self] [current method] [current args]" - :public object [current method] {*}$args - } - :public method forward args { - ::nsf::log warn "LEGACY CMD: [self] [current method] [current args]" - :public object [current method] {*}$args - } - :public method filter args { - ::nsf::log warn "LEGACY CMD: [self] [current method] [current args]" - :object [current method] {*}$args + nx::Object eval { + # + # Definitions redirected to "object" + # + foreach m {alias filter forward method mixin property variable} { + :public method $m {args} { + nx::configure plain-object-method-warning + :object [current method] {*}[current args] + } } - :public method mixin args { - ::nsf::log warn "LEGACY CMD: [self] [current method] [current args]" - :object [current method] {*}$args + # + # info subcmmands + # + foreach m {method methods slots variables + "filter guards" "filter methods" + "mixin guards" "mixin classes" + } { + :public method "info $m" {args} [subst -nocommands { + nx::configure plain-object-method-warning + :info object $m {*}[current args] + }] } - :public method property args { - ::nsf::log warn "LEGACY CMD: [self] [current method] [current args]" - :object [current method] {*}$args - } - :public method variable args { - ::nsf::log warn "LEGACY CMD: [self] [current method] [current args]" - :object [current method] {*}$args - } - - :public alias "info method" ::nsf::methods::object::info::method - :public alias "info methods" ::nsf::methods::object::info::methods - :public alias "info filter guard" ::nsf::methods::object::info::filterguard - :public alias "info filter methods" ::nsf::methods::object::info::filtermethods - :public alias "info mixin guard" ::nsf::methods::object::info::mixinguard - :public alias "info mixin classes" ::nsf::methods::object::info::mixinclasses - - :public method "info slots" args { - ::nsf::log warn "LEGACY CMD: [self] [current method] [current args]" - :object [current method] {*}$args - } - } @@ -59,13 +55,15 @@ # method require, base cases # :method "require method" {methodName} { + nx::configure plain-object-method-warning ::nsf::method::require [::nsf::self] $methodName 1 return [:info lookup method $methodName] } # # method require, public explicitly # :method "require public method" {methodName} { + nx::configure plain-object-method-warning set result [:require object method $methodName] ::nsf::method::property [self] $result call-protected false return $result @@ -74,6 +72,7 @@ # method require, protected explicitly # :method "require protected method" {methodName} { + nx::configure plain-object-method-warning set result [:require object method $methodName] ::nsf::method::property [self] $result call-protected true return $result