Index: TODO =================================================================== diff -u -r87fd90096e05bda94f2f6c90fdab8dc540c84235 -r53113de78cadfd4913718676222d6021d4e7a3fc --- TODO (.../TODO) (revision 87fd90096e05bda94f2f6c90fdab8dc540c84235) +++ TODO (.../TODO) (revision 53113de78cadfd4913718676222d6021d4e7a3fc) @@ -5688,14 +5688,21 @@ - extended regression test for introspecting nsf::cmd::info definition + "-deprecated" and "-debug" +- nx: added new introspection options + /cls/ info method debug + /cls/ info method deprecated + /obj/ info object method debug + /obj/ info object method deprecated +- extended regression test + ======================================================================== TODO: - handling "deprecated" and "debug" properties in serializer (for methods and introspection) * addressing scripted methods is not sufficient (e.g. "-debug" on c-implemented methods) * handling for XOTcl methods * probably, the most uniform way is to implement this via separate nsf::method::property cmds, but also there it should be probably integrated with "info methods" as an additional - filter ... (like e.g. + filter ... like e.g. ... info methods .. -flags none|debug|deprecated ... or ... info methods .. -deprecated ... @@ -5704,15 +5711,19 @@ ... info method deprecated ... ... info method debug ... - which speaks rather tor the 2nd approach for "info methods" + which speaks rather for the 2nd approach for "info methods" - add regression tests for debug and deprecated in methods (behavior + introspection) - add regression tests for nsf::proc flags -debug and -deprecated (behavior) - add to doc: - info method callprotection - info object method callprotection - info baseclass + /cls/ info method callprotection + /cls/ info method debug + /cls/ info method deprecated + /obj/ info baseclass + /obj/ info object method callprotection + /obj/ info object method debug + /obj/ info object method deprecated nsf::proc flags -debug and -deprecated - gcc6: Index: library/nx/nx.tcl =================================================================== diff -u -r5a162b098b6a9550218646d470b274769bda8da1 -r53113de78cadfd4913718676222d6021d4e7a3fc --- library/nx/nx.tcl (.../nx.tcl) (revision 5a162b098b6a9550218646d470b274769bda8da1) +++ library/nx/nx.tcl (.../nx.tcl) (revision 53113de78cadfd4913718676222d6021d4e7a3fc) @@ -888,14 +888,15 @@ :method "info method returns" {name} {: ::nsf::methods::class::info::method returns $name} :method "info method callprotection" {name} { if {[::nsf::method::property [self] $name call-protected]} { - puts stderr "YES" return protected } elseif {[::nsf::method::property [self] $name call-private]} { return private } else { return public } } + :method "info method deprecated" {name} {::nsf::method::property [self] $name deprecated} + :method "info method debug" {name} {::nsf::method::property [self] $name debug} } Object eval { @@ -928,6 +929,8 @@ return public } } + :method "info object method deprecated" {name} {::nsf::method::property [self] -per-object $name deprecated} + :method "info object method debug" {name} {::nsf::method::property [self] -per-object $name debug} } ###################################################################### Index: tests/method-parameter.test =================================================================== diff -u -r5a162b098b6a9550218646d470b274769bda8da1 -r53113de78cadfd4913718676222d6021d4e7a3fc --- tests/method-parameter.test (.../method-parameter.test) (revision 5a162b098b6a9550218646d470b274769bda8da1) +++ tests/method-parameter.test (.../method-parameter.test) (revision 53113de78cadfd4913718676222d6021d4e7a3fc) @@ -107,7 +107,7 @@ nx::test case flag-in-ensemble { nx::Class create C - set info {info baseclass, info children, info class, info filters, info has mixin, info has namespace, info has type, info heritage, info info, info instances, info lookup filter, info lookup filters, info lookup method, info lookup methods, info lookup mixins, info lookup parameters, info lookup slots, info lookup syntax, info lookup variables, info method args, info method body, info method callprotection, info method definition, info method definitionhandle, info method exists, info method handle, info method origin, info method parameters, info method registrationhandle, info method returns, info method submethods, info method syntax, info method type, info methods, info mixinof, info mixins, info name, info object filters, info object method args, info object method body, info object method callprotection, info object method definition, info object method definitionhandle, info object method exists, info object method handle, info object method origin, info object method parameters, info object method registrationhandle, info object method returns, info object method submethods, info object method syntax, info object method type, info object methods, info object mixins, info object slots, info object variables, info parent, info precedence, info slots, info subclasses, info superclasses, info variable definition, info variable name, info variable parameter, info variables, info vars} + set info {info baseclass, info children, info class, info filters, info has mixin, info has namespace, info has type, info heritage, info info, info instances, info lookup filter, info lookup filters, info lookup method, info lookup methods, info lookup mixins, info lookup parameters, info lookup slots, info lookup syntax, info lookup variables, info method args, info method body, info method callprotection, info method debug, info method definition, info method definitionhandle, info method deprecated, info method exists, info method handle, info method origin, info method parameters, info method registrationhandle, info method returns, info method submethods, info method syntax, info method type, info methods, info mixinof, info mixins, info name, info object filters, info object method args, info object method body, info object method callprotection, info object method debug, info object method definition, info object method definitionhandle, info object method deprecated, info object method exists, info object method handle, info object method origin, info object method parameters, info object method registrationhandle, info object method returns, info object method submethods, info object method syntax, info object method type, info object methods, info object mixins, info object slots, info object variables, info parent, info precedence, info slots, info subclasses, info superclasses, info variable definition, info variable name, info variable parameter, info variables, info vars} ? {C info superclasses} "::nx::Object" ? {C info -a superclass} "unable to dispatch sub-method \"-a\" of ::C info; valid are: $info" Index: tests/methods.test =================================================================== diff -u -r07b40a4e9fcf594bd65394299372cd8c8556085f -r53113de78cadfd4913718676222d6021d4e7a3fc --- tests/methods.test (.../methods.test) (revision 07b40a4e9fcf594bd65394299372cd8c8556085f) +++ tests/methods.test (.../methods.test) (revision 53113de78cadfd4913718676222d6021d4e7a3fc) @@ -1316,7 +1316,31 @@ ? bar 2 } +nx::test case debug+deprecated { + nx::Class create C { + :public method foo {} {return 1} + :public method bar {} {return 1} + :public object method ofoo {} {return 1} + :public object method obar {} {return 1} + } + + ? {C info method debug foo} 0 + ? {C info method deprecated bar} 0 + ? {C info object method debug ofoo} 0 + ? {C info object method deprecated obar} 0 + + ? {nsf::method::property C foo debug 1} 1 + ? {nsf::method::property C bar deprecated 1} 1 + ? {nsf::method::property C -per-object ofoo debug 1} 1 + ? {nsf::method::property C -per-object obar deprecated 1} 1 + + ? {C info method debug foo} 1 + ? {C info method deprecated bar} 1 + ? {C info object method debug ofoo} 1 + ? {C info object method deprecated obar} 1 +} + # # Local variables: # mode: tcl