Index: library/nx/nx.tcl =================================================================== diff -u -r91007cd5fdd2f8f125fdd433ef7701574e8167d2 -ra615b76dd389290567bc8506fec6fa0a3b2c14d2 --- library/nx/nx.tcl (.../nx.tcl) (revision 91007cd5fdd2f8f125fdd433ef7701574e8167d2) +++ library/nx/nx.tcl (.../nx.tcl) (revision a615b76dd389290567bc8506fec6fa0a3b2c14d2) @@ -1617,11 +1617,21 @@ -disposition slotassign \ -settername "object mixin" -forwardername object-mixin -elementtype mixinreg } - ::nx::RelationSlot create ::nx::Object::slot::object-filter \ - -methodname "::nx::Object::slot::__object::filter" \ - -multiplicity 0..n \ - -settername "object filter" -forwardername object-filter -elementtype filterreg if {0} { + ::nx::RelationSlot create ::nx::Object::slot::object-filter \ + -methodname "::nx::Object::slot::__object::filter" \ + -multiplicity 0..n \ + -settername "object filter" -forwardername object-filter -elementtype filterreg + } + if {1} { + ::nx::RelationSlot create ::nx::Object::slot::object-filter \ + -multiplicity 0..n \ + -defaultmethods get \ + -disposition slotassign \ + -settername "object filter" -forwardername object-filter -elementtype filterreg + } + + if {0} { #puts stderr =============1 ::nx::RelationSlot create ::nx::Class::slot::mixin \ -multiplicity 0..n \ @@ -1638,19 +1648,27 @@ -forwardername "class-mixin" -elementtype mixinreg } if {1} { - #puts stderr =============3 ::nx::RelationSlot create ::nx::Class::slot::mixin \ -multiplicity 0..n \ - -methodname "mixin" \ -defaultmethods get \ -disposition slotassign \ -forwardername "class-mixin" -elementtype mixinreg - #puts stderr =============4 } - ::nx::RelationSlot create ::nx::Class::slot::filter \ - -multiplicity 0..n \ - -forwardername class-filter -elementtype filterreg + if {0} { + ::nx::RelationSlot create ::nx::Class::slot::filter \ + -multiplicity 0..n \ + -forwardername class-filter -elementtype filterreg + } + if {1} { + ::nx::RelationSlot create ::nx::Class::slot::filter \ + -multiplicity 0..n \ + -defaultmethods get \ + -disposition slotassign \ + -forwardername class-filter -elementtype filterreg + } + + # # Define "class" as a ObjectParameterSlot defined as alias # Index: tests/class-method.test =================================================================== diff -u -r12319faaf20df7116346558bd948b0edda9124eb -ra615b76dd389290567bc8506fec6fa0a3b2c14d2 --- tests/class-method.test (.../class-method.test) (revision 12319faaf20df7116346558bd948b0edda9124eb) +++ tests/class-method.test (.../class-method.test) (revision a615b76dd389290567bc8506fec6fa0a3b2c14d2) @@ -69,9 +69,9 @@ ? {::C class mixin set ""} "" ? {::C class info mixin classes} "" - ? {::C class filter f} f + ? {::C class filter set f} f ? {::C class info filter methods} f - ? {::C class filter ""} "" + ? {::C class filter set ""} "" ? {::C class info filter methods} "" ? {lsort [::C info object methods]} "a f foo fwd p v2" Index: tests/disposition.test =================================================================== diff -u -r12319faaf20df7116346558bd948b0edda9124eb -ra615b76dd389290567bc8506fec6fa0a3b2c14d2 --- tests/disposition.test (.../disposition.test) (revision 12319faaf20df7116346558bd948b0edda9124eb) +++ tests/disposition.test (.../disposition.test) (revision a615b76dd389290567bc8506fec6fa0a3b2c14d2) @@ -985,7 +985,7 @@ C public method intercept args { next } - C filter intercept + C filter set intercept # N+4 |:CscFrame @Type(ENSEMBLE) | <-- foo (leaf) # N+3 |:CscFrame @Call(ENSEMBLE) | <-- FOO (root) @@ -1010,7 +1010,7 @@ } "::c2--FOO foo--foo" - C filter "" + C filter set "" # / / / / / / / / / / / / / / / / / / / / / / / / / / / / / # b) Between root and intermittent or inbetween the set of # intermittent frames (i.e., indirection at the level of @@ -1041,7 +1041,7 @@ C::slot::__FOO public object method intercept {} { return "[current]--[next]" } - C::slot::__FOO object filter intercept + C::slot::__FOO object filter set intercept ? {C::slot::__FOO foo} "::C::slot::__FOO--::C::slot::__FOO--foo--foo" C setObjectParams [list] @@ -1294,10 +1294,8 @@ # Dispatch with a method handle # ::T mixin set {} - #puts stderr =================1 ? [list [T create t] $methods(z) XXX] \ "CURRENT-::obj-DELEGATOR-::t-UNKNOWNMETHOD-XXX-PATH-::nsf::classes::T::z" - #puts stderr =================3 T setObjectParams x:alias,method=$methods(z) ? {T create t XXX} "CURRENT-::obj-DELEGATOR-::t-UNKNOWNMETHOD-XXX-PATH-::nsf::classes::T::z" \ "Non-object FQ selector with default unknown handler" Index: tests/forward.test =================================================================== diff -u -r714fdeeeeca44ee6f77d93349a0afec4c4b139cc -ra615b76dd389290567bc8506fec6fa0a3b2c14d2 --- tests/forward.test (.../forward.test) (revision 714fdeeeeca44ee6f77d93349a0afec4c4b139cc) +++ tests/forward.test (.../forward.test) (revision a615b76dd389290567bc8506fec6fa0a3b2c14d2) @@ -452,22 +452,22 @@ ? [list set _ [namespace current]] ::NS ? [list set _ [NS create m1]] ::NS::m1 - NS filter f + NS filter set f ? [list set _ [NS create m2]] ::NS::m2 - NS filter "" + NS filter set "" namespace eval ::test { ? [list set _ [NS create m3]] ::test::m3 - NS filter f + NS filter set f ? [list set _ [NS create m4]] ::test::m4 - NS filter "" + NS filter set "" } namespace eval test { ? [list set _ [NS create m5]] ::NS::test::m5 - NS filter f + NS filter set f ? [list set _ [NS create m6]] ::NS::test::m6 - NS filter "" + NS filter set "" } } @@ -477,22 +477,22 @@ ? [list set _ [namespace current]] ::NS ? [list set _ [NS create i1]] ::NS::i1 - NS filter f + NS filter set f ? [list set _ [NS create i2]] ::NS::i2 - NS filter "" + NS filter set "" namespace eval ::test { ? [list set _ [NS create i3]] ::test::i3 - NS filter f + NS filter set f ? [list set _ [NS create i4]] ::test::i4 - NS filter "" + NS filter set "" } namespace eval test { ? [list set _ [NS create i5]] ::NS::test::i5 - NS filter f + NS filter set f ? [list set _ [NS create i6]] ::NS::test::i6 - NS filter "" + NS filter set "" } } @@ -505,17 +505,17 @@ #puts ==== ? [list set _ [NS create n1]] ::n1 - NS filter f + NS filter set f ? [list set _ [NS create n2]] ::n2 - NS filter "" + NS filter set "" #puts ==== namespace eval test { ? [list set _ [NS create n1]] ::test::n1 ? [list set _ [NS create n3]] ::test::n3 - NS filter f + NS filter set f ? [list set _ [NS create n4]] ::test::n4 - NS filter "" + NS filter set "" } } Index: tests/info-method.test =================================================================== diff -u -r12319faaf20df7116346558bd948b0edda9124eb -ra615b76dd389290567bc8506fec6fa0a3b2c14d2 --- tests/info-method.test (.../info-method.test) (revision 12319faaf20df7116346558bd948b0edda9124eb) +++ tests/info-method.test (.../info-method.test) (revision a615b76dd389290567bc8506fec6fa0a3b2c14d2) @@ -389,34 +389,34 @@ ? {o info lookup methods create} "" ? {o info lookup methods configure} configure ? {o info lookup method configure} "::nsf::classes::nx::Object::configure" - ? {o object filter f} "f" + ? {o object filter set f} "f" ? {o object filter guard f { 1 == 1 }} "" ? {o info object filter guard f} " 1 == 1 " ? {o object filter guard f} " 1 == 1 " - o object filter "" + o object filter set "" nx::Class create Foo ? {Foo method f args ::nx::next} "::nsf::classes::Foo::f" ? {Foo method f2 args ::nx::next} "::nsf::classes::Foo::f2" - ? {Foo filter {f f2}} "f f2" + ? {Foo filter set {f f2}} "f f2" ? {Foo info filter methods} "f f2" ? {Foo filter guard f {2 == 2}} "" ? {Foo info filter guard f} "2 == 2" ? {Foo info filter methods -guards f} "{f -guard {2 == 2}}" ? {Foo info filter methods -guards f2} "f2" ? {Foo info filter methods -guards} "{f -guard {2 == 2}} f2" - ? {Foo filter {}} "" + ? {Foo filter set {}} "" ? {Foo object method f args ::nx::next} "::Foo::f" ? {Foo object method f2 args ::nx::next} "::Foo::f2" - ? {Foo object filter {f f2}} "f f2" + ? {Foo object filter set {f f2}} "f f2" ? {Foo info object filter methods} "f f2" ? {Foo object filter guard f {2 == 2}} "" ? {Foo info object filter guard f} "2 == 2" ? {Foo info object filter methods -guards f} "{f -guard {2 == 2}}" ? {Foo info object filter methods -guards f2} "f2" ? {Foo info object filter methods -guards} "{f -guard {2 == 2}} f2" - ? {Foo object filter {}} "" + ? {Foo object filter set {}} "" Foo destroy nx::Class create Fly @@ -721,7 +721,7 @@ ? {C info configure syntax} "/::C/ ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" # ? {C info configure syntax a} "/::C/ ?-a /value/?" - ? {C info configure parameters } "-a {-b 1} -object-mixin:mixinreg,slot=::nx::Object::slot::object-mixin,slotassign,method=object-mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" + ? {C info configure parameters } "-a {-b 1} -object-mixin:mixinreg,slot=::nx::Object::slot::object-mixin,slotassign,method=object-mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,slot=::nx::Object::slot::object-filter,slotassign,method=object-filter,0..n __initblock:cmd,optional,noleadingdash" # ? {C info parameter list} "-a -b -noinit -object-mixin -class -object-filter __initblock" # ? {C info parameter names} "a b noinit object-mixin class object-filter __initblock" Index: tests/info-variable.test =================================================================== diff -u -r12319faaf20df7116346558bd948b0edda9124eb -ra615b76dd389290567bc8506fec6fa0a3b2c14d2 --- tests/info-variable.test (.../info-variable.test) (revision 12319faaf20df7116346558bd948b0edda9124eb) +++ tests/info-variable.test (.../info-variable.test) (revision a615b76dd389290567bc8506fec6fa0a3b2c14d2) @@ -35,7 +35,7 @@ -name -object-mixin:mixinreg,slot=::nx::Object::slot::object-mixin,slotassign,method=object-mixin,0..n -class:class,alias,method=::nsf::methods::object::class --object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n +-object-filter:filterreg,slot=::nx::Object::slot::object-filter,slotassign,method=object-filter,0..n __initblock:cmd,optional,noleadingdash" ? {Person info configure parameters age} "-age:integer" Index: tests/interceptor-slot.test =================================================================== diff -u -r12319faaf20df7116346558bd948b0edda9124eb -ra615b76dd389290567bc8506fec6fa0a3b2c14d2 --- tests/interceptor-slot.test (.../interceptor-slot.test) (revision 12319faaf20df7116346558bd948b0edda9124eb) +++ tests/interceptor-slot.test (.../interceptor-slot.test) (revision a615b76dd389290567bc8506fec6fa0a3b2c14d2) @@ -163,7 +163,7 @@ ? {cc info object filter methods} "" ? {::nsf::relation cc object-filter filterA} filterA ? {cc info object filter methods} "filterA" - ? {cc object filter filterB} "filterB" + ? {cc object filter set filterB} "filterB" ? {::nsf::relation cc object-filter} "filterB" ? {cc info object filter methods} "filterB" ? {cc object filter add filterD} "filterD filterB" @@ -240,7 +240,7 @@ ? {ob bar} {::ob: unable to dispatch method 'bar'} ? {ob baz} {} - Foo filter myfilter + Foo filter set myfilter # create through filter ? {Foo create ob} ::ob Index: tests/parameters.test =================================================================== diff -u -r91007cd5fdd2f8f125fdd433ef7701574e8167d2 -ra615b76dd389290567bc8506fec6fa0a3b2c14d2 --- tests/parameters.test (.../parameters.test) (revision 91007cd5fdd2f8f125fdd433ef7701574e8167d2) +++ tests/parameters.test (.../parameters.test) (revision a615b76dd389290567bc8506fec6fa0a3b2c14d2) @@ -4,9 +4,14 @@ #::nx::configure defaultMethodCallProtection false -set ::trailer "-object-mixin:mixinreg,slot=::nx::Object::slot::object-mixin,slotassign,method=object-mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" +set objectFilter "-object-filter:filterreg,slot=::nx::Object::slot::object-filter,slotassign,method=object-filter,0..n" +set objectMixin "-object-mixin:mixinreg,slot=::nx::Object::slot::object-mixin,slotassign,method=object-mixin,0..n" +set initBlock "__initblock:cmd,optional,noleadingdash" +set filter "-filter:filterreg,slot=::nx::Class::slot::filter,slotassign,method=class-filter,0..n" +set ::trailer "$objectMixin -class:class,alias,method=::nsf::methods::object::class $objectFilter $initBlock" + nx::test case dummy { ? {::namespace current} :: set o [Object create o] @@ -278,7 +283,7 @@ C create c1 ? {C eval :__objectparameter} \ - "{-superclass:class,alias,method=::nsf::methods::class::superclass,1..n ::nx::Object} -mixin:mixinreg,slot=::nx::Class::slot::mixin,slotassign,method=class-mixin,0..n -filter:filterreg,alias,0..n -object-mixin:mixinreg,slot=::nx::Object::slot::object-mixin,slotassign,method=object-mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" + "{-superclass:class,alias,method=::nsf::methods::class::superclass,1..n ::nx::Object} -mixin:mixinreg,slot=::nx::Class::slot::mixin,slotassign,method=class-mixin,0..n $::filter $::objectMixin -class:class,alias,method=::nsf::methods::object::class $::objectFilter $::initBlock" #### TOOD: remove or add #? {c1 eval :__objectparameter} \ Index: tests/plain-object-method.test =================================================================== diff -u -r12319faaf20df7116346558bd948b0edda9124eb -ra615b76dd389290567bc8506fec6fa0a3b2c14d2 --- tests/plain-object-method.test (.../plain-object-method.test) (revision 12319faaf20df7116346558bd948b0edda9124eb) +++ tests/plain-object-method.test (.../plain-object-method.test) (revision a615b76dd389290567bc8506fec6fa0a3b2c14d2) @@ -8,7 +8,7 @@ :public object method f args {next} } ? {o mixin set M1} "::o: unable to dispatch method 'mixin'" - ? {o filter f} "::o: unable to dispatch method 'filter'" + ? {o filter set f} "::o: unable to dispatch method 'filter'" ? {lsort [o info object methods]} "f" ? {lsort [o info]} "valid submethods of ::o info: children class configure has info lookup name object parameter parent precedence variable vars" @@ -54,9 +54,9 @@ ? {o mixin set ""} "" ? {o info mixin classes} "" - ? {o filter f} f + ? {o filter set f} f ? {o info filter methods} f - ? {o filter ""} "" + ? {o filter set ""} "" ? {o info filter methods} "" ? {lsort [o info object methods]} "a f foo fwd p v2" Index: tests/protected.test =================================================================== diff -u -racc540eae81024718461724ce69e7971fa9ddfa9 -ra615b76dd389290567bc8506fec6fa0a3b2c14d2 --- tests/protected.test (.../protected.test) (revision acc540eae81024718461724ce69e7971fa9ddfa9) +++ tests/protected.test (.../protected.test) (revision a615b76dd389290567bc8506fec6fa0a3b2c14d2) @@ -286,7 +286,7 @@ ? {d1 bar} "::d1: unable to dispatch method 'bar'" # remove the filter - d1 object filter "" + d1 object filter set "" # define call to private method via method handle C public method foo {} { return "C.foo [[self] [C info method registrationhandle bar]]"} Index: tests/submethods.test =================================================================== diff -u -r12319faaf20df7116346558bd948b0edda9124eb -ra615b76dd389290567bc8506fec6fa0a3b2c14d2 --- tests/submethods.test (.../submethods.test) (revision 12319faaf20df7116346558bd948b0edda9124eb) +++ tests/submethods.test (.../submethods.test) (revision a615b76dd389290567bc8506fec6fa0a3b2c14d2) @@ -357,7 +357,7 @@ :public object method intercept args { incr :x; next; # a "filter next" } - :object filter intercept + :object filter set intercept :FOO bar # Rationale: A call count > 2 would indicate that the leaf next # triggers a further call into filter ... @@ -505,7 +505,7 @@ set c [Z new] - Z filter intercept + Z filter set intercept foreach selector [list "FOO foo" "BAR BUU boo" "baz"] { Z public method $selector {} {;} @@ -515,7 +515,7 @@ ? [list set _ [join [Z cget -msg] -]] -$root-::Z-$mh } - Z filter {} + Z filter set {} }