Index: TODO =================================================================== diff -u -N -rc790d82b4b9e44e1d8e2a303e1d4931a91f049d8 -r275da34d3d7a874a451eced58242b738c8a37d1a --- TODO (.../TODO) (revision c790d82b4b9e44e1d8e2a303e1d4931a91f049d8) +++ TODO (.../TODO) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -5442,91 +5442,29 @@ "info superclasses" and similar changes for mixins/filters will probably follow) +nx.tcl: pluralism reform part 2 +- changed methods + /cls/ info subclass -> /cls/ info subclasses + /cls/ info superclass -> /cls/ info superclasses + /cls/ mixin ... -> /cls/ mixins + /cls/ filter ... -> /cls/ filters + /cls/ object mixin ... -> /cls/ object mixins + /cls/ object filter ... -> /cls/ object filters +- changed configure parameters + /cls/ configure -mixin -> /cls/ configure -mixins + /cls/ configure -filter -> /cls/ configure -filters + /obj/ configure -object-mixin -> /obj/ configure -object-mixins + /obj/ configure -object-filter -> /obj/ configure -object-filters +- added handling for calling relationslot with unknown sub method + ======================================================================== TODO: - finish pluaral reform +- update migration guide and tutorial - maybe introdouce "allowabbrev" flag - set nodashalnum for int types -- shouldn't "info subclass" be named "info subclasses"? - - >>> Same for "info superclass". If the introspection interface uses - the plural, then also the relation slots should state the - plural: -superclasses, -object-mixins, -class-mixins, ... - (I am in favour). - >>> we have no "-class-mixins", but only "-mixins". - >>> true - >>> but we have also -filters and object-filters and the - the accessor methods "... filters add ...", and - ".... object filters add ....", and we - would need "info mixinofs" - >>>> agreed for the filter cases, but mixinof is different: it - reads as "is mixin of", with the mixin class as subject in - this phrase being naturally singular. plural would be - fitting if the phrase would roll out as "cls has - superclasses", "cls has filters", "cls has mixins" etc. - >>> i would accept this argumentation, if i would have written - ismixinsof, ... of ismixinsofs... like karl valentins - semmelnknödeln. - >>> more seriously, the question is, what kind of argumentation line we - try to follow. (a) if something is setting/returning potentially a - list (set) of values, then plural -> mixinofs - (b) if we are arguing about the kind of relationship -> mixinof - buf if we argue about the kind of relationship then we have - a "superclass relationship", and not a "superclasses relationship", - and same with "mixin relation", etc. - >>> i am not happy. is there any language out there that uses e.g. - the term "superclasses" for a situation, where in most - cases a single superclass is used? - nx::Class create Student -superclasses Person - looks strange. - - >>>> - 1) NO, but there are not many languages that use a substantival keyword - such as "superclass" or "superclasses" either: - - see http://rosettacode.org/wiki/Inheritance/Multiple - - TclOO being the only one, in its OTcl/XOTcl heritage :) - - Most, if using any keyword at all, use a verb: extend(s), - inherit(s), which does not run into the singular/plural "issue" - (but other ones: -extends/-inherits, -mixes, -object-mixes? etc.) - - 2) Frag uses a substantival keyword in its plural form: - - http://www.infosys.tuwien.ac.at/Staff/zdun/frag-doc/frag-lang-toc.html - - classes, superclasses, mixins, ... - - Whatever the decision, i would just vote for consistency between - introspection and intercession (info superclass <-> -superclass - vs. superclasses <-> -superclasses) ... - >>> funny, one XOTcl child kept "superclass", - the other one switched to "superclasses", - and nobody else names the relation. - >>> in case we would make the transition, i am not sure, who will take - care about the collateral damage, writing change scripts, etc. - especially for programs using both xotcl and nx. - l@wu has 600.000 .tcl locs, more the 350.000 xo-based. - >>> if one script is using both XOTcl and NX (which is a reality - in OpenACS) the transition is even worse, and the consequences - are that one has to know in detail, whether some tcl-cmd - is from xotcl or nx. pretty sure, this would be an ongoing - source for confusion. - >>> writing programs working with old and new nx is a mess. - -- Can we remove the -childof nonpos param of Class->new()? It might - also interfere with a childof property/configuration option if - defined by an application ... - -- how should we treat cyclic subclass relationships built via class mixins. - (either complain at mixin registration or soft warnings or ignoring - - since redundant mixin classes are ignored so far). - - if we disallow cycles in class-mixins, we can't do "nx::Object mixin add M" - - should we change "/obj/ info lookup syntax /methodName/" to return obj and method as well? (similar to "info method syntax /methodName/") - we could drop methods::object::info::objectparameter Index: doc/example-scripts/bagel.tcl =================================================================== diff -u -N -rea09e74f9faa81e79037b6cb14a5798627637388 -r275da34d3d7a874a451eced58242b738c8a37d1a --- doc/example-scripts/bagel.tcl (.../bagel.tcl) (revision ea09e74f9faa81e79037b6cb14a5798627637388) +++ doc/example-scripts/bagel.tcl (.../bagel.tcl) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -100,7 +100,8 @@ :property -incremental {toppings:0..n ""} }} ::SpreadableBagel -? {SpreadableBagel info superclass} ::Bagel +? {SpreadableBagel cget -superclass} ::Bagel +? {SpreadableBagel info superclasses} ::Bagel ? {SpreadableBagel info heritage} {::Bagel ::nx::Object} Index: doc/example-scripts/ruby-mixins.tcl =================================================================== diff -u -N -r3cbf24ff95e38976cdc905ec0e8014d9d754ad6f -r275da34d3d7a874a451eced58242b738c8a37d1a --- doc/example-scripts/ruby-mixins.tcl (.../ruby-mixins.tcl) (revision 3cbf24ff95e38976cdc905ec0e8014d9d754ad6f) +++ doc/example-scripts/ruby-mixins.tcl (.../ruby-mixins.tcl) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -32,7 +32,7 @@ nx::Class eval { :protected method module {name:class} { - nsf::relation::set [self] superclass [concat $name [:info superclass]] + nsf::relation::set [self] superclass [concat $name [:info superclasses]] } } @@ -124,14 +124,14 @@ # the precedence list. A decorator is able to modify the behavior of # all of the methods of the class, where it is mixed into. -? {g1 object mixin set Mix} "::Mix" +? {g1 object mixins set Mix} "::Mix" ? {g1 info precedence} "::Mix ::Group ::Enumerable ::nx::Object" ? {g1 count} {alpha 3 omega} # For the time being, remove the mixin class again. -? {g1 object mixin set ""} "" +? {g1 object mixins set ""} "" ? {g1 info precedence} "::Group ::Enumerable ::nx::Object" # @@ -213,7 +213,7 @@ # and decorates the instances of +ATeam+ as well the instances of its # specializations (like e.g. +SpecialForce+). -? {ATeam mixin set Mix} "::Mix" +? {ATeam mixins set Mix} "::Mix" ? {s1 info precedence} "::Mix ::SpecialForce ::ATeam ::Enumerable ::nx::Object" Index: library/mongodb/nx-mongo.tcl =================================================================== diff -u -N -r4718ffe23d7b30ccb68524cd9fcaf788a5889b87 -r275da34d3d7a874a451eced58242b738c8a37d1a --- library/mongodb/nx-mongo.tcl (.../nx-mongo.tcl) (revision 4718ffe23d7b30ccb68524cd9fcaf788a5889b87) +++ library/mongodb/nx-mongo.tcl (.../nx-mongo.tcl) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -744,7 +744,7 @@ # :method init {} { - :mixin add ::nx::mongo::Object + :mixins add ::nx::mongo::Object :mongo_setup } Index: library/nx/class-method.tcl =================================================================== diff -u -N -r471c9589c601e576f2bc5f3e2dd4c554a0ceee1c -r275da34d3d7a874a451eced58242b738c8a37d1a --- library/nx/class-method.tcl (.../class-method.tcl) (revision 471c9589c601e576f2bc5f3e2dd4c554a0ceee1c) +++ library/nx/class-method.tcl (.../class-method.tcl) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -9,7 +9,7 @@ # nx::Class create C { # :public object method foo args {....} # :object property p:integer -# :object mixin add M +# :object mixins add M # #... # puts [:info object methods] # } @@ -21,7 +21,7 @@ # nx::Object create o { # :public class method foo args {....} # :class property p:integer -# :class mixin add M +# :class mixins add M # #... # puts [:class info methods] # } @@ -71,10 +71,10 @@ # foreach m { alias - filter + filters forward method - mixin + mixins property variable } { @@ -153,4 +153,4 @@ return $result } } -} \ No newline at end of file +} Index: library/nx/nx.tcl =================================================================== diff -u -N -rc790d82b4b9e44e1d8e2a303e1d4931a91f049d8 -r275da34d3d7a874a451eced58242b738c8a37d1a --- library/nx/nx.tcl (.../nx.tcl) (revision c790d82b4b9e44e1d8e2a303e1d4931a91f049d8) +++ library/nx/nx.tcl (.../nx.tcl) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -832,8 +832,8 @@ if {[info exists pattern]} {lappend cmd $pattern} return [: {*}$cmd] } - :alias "info subclass" ::nsf::methods::class::info::subclass - :alias "info superclass" ::nsf::methods::class::info::superclass + :alias "info subclasses" ::nsf::methods::class::info::subclass + :alias "info superclasses" ::nsf::methods::class::info::superclass :method "info variables" {pattern:optional} { set cmd {info slots -type ::nx::VariableSlot} if {[info exists pattern]} {lappend cmd $pattern} @@ -965,10 +965,10 @@ # Combine two classes and return the more specialized one # if {$old eq "" || $old eq $required} {return $required} - if {[$required info superclass -closure $old] ne ""} { + if {[$required info superclasses -closure $old] ne ""} { #puts stderr "required $required has $old as superclass => specializing" return $required - } elseif {[$required info subclass -closure $old] ne ""} { + } elseif {[$required info subclasses -closure $old] ne ""} { #puts stderr "required $required is more general than $old => keep $old" return $old } else { @@ -1305,11 +1305,19 @@ ObjectParameterSlot public method onError {cmd msg} { if {[string match "%1 requires argument*" $msg]} { + set template {wrong # args: use \"$cmd [join $methods |]\"} + } elseif {[string match "*unknown for slot*" $msg]} { + lassign $cmd slot calledMethod obj . + regexp {=(.*)$} $calledMethod . calledMethod + regexp {::([^:]+)$} $slot . slot + set template {submethod $calledMethod undefined for $slot: use \"$obj $slot [join $methods |]\"} + } + if {[info exists template]} { set methods "" foreach m [lsort [:info lookup methods -callprotection public value=*]] { lappend methods [lindex [split $m =] end] } - return -code error "wrong # args: use \"$cmd [join $methods |]\"" + return -code error [subst $template] } return -code error $msg } @@ -1604,28 +1612,30 @@ # mixin # filter - ::nx::RelationSlot create ::nx::Object::slot::object-mixin \ + ::nx::RelationSlot create ::nx::Object::slot::object-mixins \ -multiplicity 0..n \ -defaultmethods {} \ -disposition slotset \ - -settername "object mixin" \ + -forwardername object-mixin \ + -settername "object mixins" \ -elementtype mixinreg - ::nx::RelationSlot create ::nx::Object::slot::object-filter \ + ::nx::RelationSlot create ::nx::Object::slot::object-filters \ -multiplicity 0..n \ -defaultmethods {} \ -disposition slotset \ - -settername "object filter" \ + -forwardername object-filter \ + -settername "object filters" \ -elementtype filterreg - ::nx::RelationSlot create ::nx::Class::slot::mixin \ + ::nx::RelationSlot create ::nx::Class::slot::mixins \ -multiplicity 0..n \ -defaultmethods {} \ -disposition slotset \ -forwardername "class-mixin" \ -elementtype mixinreg - ::nx::RelationSlot create ::nx::Class::slot::filter \ + ::nx::RelationSlot create ::nx::Class::slot::filters \ -multiplicity 0..n \ -defaultmethods {} \ -disposition slotset \ @@ -1664,35 +1674,35 @@ # # Define method "guard" for mixin- and filter-slots of Object and Class # - ::nx::Object::slot::object-filter object method value=guard {obj prop filter guard:optional} { + ::nx::Object::slot::object-filters object method value=guard {obj prop filter guard:optional} { if {[info exists guard]} { ::nsf::directdispatch $obj ::nsf::methods::object::filterguard $filter $guard } else { $obj info object filter guard $filter } } - ::nx::Class::slot::filter object method value=guard {obj prop filter guard:optional} { + ::nx::Class::slot::filters object method value=guard {obj prop filter guard:optional} { if {[info exists guard]} { ::nsf::directdispatch $obj ::nsf::methods::class::filterguard $filter $guard } else { $obj info filter guard $filter } } - ::nx::Object::slot::object-mixin object method value=guard {obj prop mixin guard:optional} { + ::nx::Object::slot::object-mixins object method value=guard {obj prop mixin guard:optional} { if {[info exists guard]} { ::nsf::directdispatch $obj ::nsf::methods::object::mixinguard $mixin $guard } else { $obj info object mixin guard $mixin } } - ::nx::Class::slot::mixin object method value=guard {obj prop filter guard:optional} { + ::nx::Class::slot::mixins object method value=guard {obj prop filter guard:optional} { if {[info exists guard]} { ::nsf::directdispatch $obj ::nsf::methods::class::mixinguard $filter $guard } else { $obj info mixin guard $filter } } - #::nsf::method::alias ::nx::Class::slot::object-filter guard ::nx::Object::slot::object-filter::guard + #::nsf::method::alias ::nx::Class::slot::object-filters guard ::nx::Object::slot::object-filters::guard # # With a special purpose eval, we could avoid the need for @@ -2447,7 +2457,7 @@ # copy class information if {[::nsf::is class $origin]} { # obj is a class, copy class specific information - ::nsf::relation::set $obj superclass [$origin info superclass] + ::nsf::relation::set $obj superclass [$origin ::nsf::methods::class::info::superclass] ::nsf::method::assertion $obj class-invar [::nsf::method::assertion $origin class-invar] ::nsf::relation::set $obj class-filter [::nsf::relation::get $origin class-filter] ::nsf::relation::set $obj class-mixin [::nsf::relation::get $origin class-mixin] @@ -2600,8 +2610,8 @@ } ### let all subclasses get the copied class as superclass if {[::nsf::is class [::nsf::self]] && $newName ne ""} { - foreach subclass [:info subclass] { - set scl [$subclass info superclass] + foreach subclass [: ::nsf::methods::class::info::subclass] { + set scl [$subclass ::nsf::methods::class::info::superclass] if {[set index [lsearch -exact $scl [::nsf::self]]] != -1} { set scl [lreplace $scl $index $index $newName] ::nsf::relation::set $subclass superclass $scl @@ -2679,14 +2689,14 @@ #interp alias {} ::nx::self {} ::nsf::self - set value "?/class .../?|?add /class/?|?delete /class/?" - set "::nsf::parameter::syntax(::nx::Object::slot::__object::object mixin)" $value - set "::nsf::parameter::syntax(::nsf::classes::nx::Class::mixin)" $value - set "::nsf::parameter::syntax(::nsf::classes::nx::Class::superclass)" $value + set value "add /class/|clear|delete /class/|get|guard /expr/|set /class .../" + set "::nsf::parameter::syntax(::nx::Object::slot::__object::object mixins)" $value + set "::nsf::parameter::syntax(::nsf::classes::nx::Class::mixins)" $value + set "::nsf::parameter::syntax(::nsf::classes::nx::Class::superclasses)" $value set "::nsf::parameter::syntax(::nsf::classes::nx::Object::class)" "?/className/?" - set value "?/filters/?|?add /filter/?|?delete /filter/?" - set "::nsf::parameter::syntax(::nx::Object::slot::__object::object filter)" $value - set "::nsf::parameter::syntax(::nsf::classes::nx::Class::filter)" $value + set value "add /filter/|clear|delete /filter/|get|guard /expr/|set /filter .../" + set "::nsf::parameter::syntax(::nx::Object::slot::__object::object filters)" $value + set "::nsf::parameter::syntax(::nsf::classes::nx::Class::filters)" $value set "::nsf::parameter::syntax(::nsf::classes::nx::Object::eval)" "/arg/ ?/arg/ ...?" unset value Index: library/nx/plain-object-method.tcl =================================================================== diff -u -N -r471c9589c601e576f2bc5f3e2dd4c554a0ceee1c -r275da34d3d7a874a451eced58242b738c8a37d1a --- library/nx/plain-object-method.tcl (.../plain-object-method.tcl) (revision 471c9589c601e576f2bc5f3e2dd4c554a0ceee1c) +++ library/nx/plain-object-method.tcl (.../plain-object-method.tcl) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -8,7 +8,7 @@ # nx::Object create o { # :public object method foo args {....} # :object property p:integer -# :object mixin add M +# :object mixins add M # #... # puts [:info object methods] # } @@ -20,7 +20,7 @@ # nx::Object create o { # :public method foo args {....} # :property p:integer -# :mixin add M +# :mixins add M # #... # puts [:info methods] # } @@ -60,10 +60,10 @@ # foreach m { alias - filter + filters forward method - mixin + mixins property variable } { @@ -142,4 +142,4 @@ } } -} \ No newline at end of file +} Index: library/serialize/serializer.tcl =================================================================== diff -u -N -r229c28e147436c1585ba9a5911cc48059ef1ed81 -r275da34d3d7a874a451eced58242b738c8a37d1a --- library/serialize/serializer.tcl (.../serializer.tcl) (revision 229c28e147436c1585ba9a5911cc48059ef1ed81) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -716,7 +716,7 @@ :method Class-needsNothing {x s} { if {![:Object-needsNothing $x $s]} {return 0} - set scs [$x info superclass] + set scs [$x ::nsf::methods::class::info::superclass] if {[$s needsOneOf $scs]} {return 0} if {[$s needsOneOf [::nsf::relation::get $x class-mixin]]} {return 0} foreach sc $scs {if {[$s needsOneOf [$sc ::nsf::methods::class::info::slotobjects]]} {return 0}} Index: tests/alias.test =================================================================== diff -u -N -r6ad766595b0095a72fb7b3a1d6d34960a013b464 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/alias.test (.../alias.test) (revision 6ad766595b0095a72fb7b3a1d6d34960a013b464) +++ tests/alias.test (.../alias.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -524,13 +524,13 @@ ? {d1 bar_} 1 ? {d1 bar2} 1 - c1 object mixin add M + c1 object mixins add M ? {c1 bar} 0 ;# upvar reaches into to mixin method ? {c1 bar_} 0 ;# upvar reaches into to mixin method ? {c1 bar2} 0 ;# upvar reaches into to mixin method - d1 object mixin add M + d1 object mixins add M ? {d1 bar} 1 ? {d1 bar_} 1 Index: tests/cget.test =================================================================== diff -u -N -rc790d82b4b9e44e1d8e2a303e1d4931a91f049d8 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/cget.test (.../cget.test) (revision c790d82b4b9e44e1d8e2a303e1d4931a91f049d8) +++ tests/cget.test (.../cget.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -55,7 +55,7 @@ # ? {p1 configure} "" - ? {p1 info lookup syntax configure} {?-sex /value/? -famnam /value/ ?-age /integer/? ?-friends /value .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {p1 info lookup syntax configure} {?-sex /value/? -famnam /value/ ?-age /integer/? ?-friends /value .../? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?} } # @@ -97,7 +97,7 @@ # ? {p1 configure} "" - ? {p1 info lookup syntax configure} {?-bar1 /value/? ?-bar2 /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {p1 info lookup syntax configure} {?-bar1 /value/? ?-bar2 /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?} # @@ -142,7 +142,7 @@ # class-level lookup # ? {C info lookup syntax configure} \ - "?-superclasses /class .../? ?-mixin /mixinreg .../? ?-filter /filterreg .../? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + "?-mixins /mixinreg .../? ?-superclasses /class .../? ?-filters /filterreg .../? ?-volatile? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" ? {C cget -superclasses} "::nx::Object" ? {C cget -superclass} "::nx::Object" ? {C cget -object-mixin} "" @@ -156,7 +156,7 @@ # object-level lookup # ? {c1 info lookup syntax configure} \ - "?-foo /value/? ?-bar /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + "?-foo /value/? ?-bar /value/? ?-volatile? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" # # query all properties from base classes Index: tests/class-method.test =================================================================== diff -u -N -r2f793442bb2a7860acc5620811dcafddc43074d3 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/class-method.test (.../class-method.test) (revision 2f793442bb2a7860acc5620811dcafddc43074d3) +++ tests/class-method.test (.../class-method.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -10,14 +10,14 @@ ? {::C public class method foo {} {return foo}} "'class' is not a method defining method" :public object method f args {next} } - ? {::C class mixin set M1} \ - "method 'class' unknown for ::C; consider '::C create class mixin set M1' instead of '::C class mixin set M1'" + ? {::C class mixins set M1} \ + "method 'class' unknown for ::C; consider '::C create class mixins set M1' instead of '::C class mixins set M1'" ? {::C class filter f} \ "method 'class' unknown for ::C; consider '::C create class filter f' instead of '::C class filter f'" ? {lsort [::C info object methods]} "f" ? {lsort [::C info]} \ - "valid submethods of ::C info: children class filter has heritage info instances lookup method methods mixin mixinof name object parent precedence slots subclass superclass variable variables vars" + "valid submethods of ::C info: children class filter has heritage info instances lookup method methods mixin mixinof name object parent precedence slots subclasses superclasses variable variables vars" } # @@ -64,19 +64,19 @@ ? {::C a} "pm1" ? {::C fwd} "pm1" - ? {::C class mixin set M1} ::M1 + ? {::C class mixins set M1} ::M1 ? {::C class info mixin classes} ::M1 - ? {::C class mixin set ""} "" + ? {::C class mixins set ""} "" ? {::C class info mixin classes} "" - ? {::C class filter set f} f + ? {::C class filters set f} f ? {::C class info filter methods} f - ? {::C class filter set ""} "" + ? {::C class filters set ""} "" ? {::C class info filter methods} "" ? {lsort [::C info object methods]} "a f foo fwd p v2" ? {lsort [::C info]} \ - "valid submethods of ::C info: children class filter has heritage info instances lookup method methods mixin mixinof name object parent precedence slots subclass superclass variable variables vars" + "valid submethods of ::C info: children class filter has heritage info instances lookup method methods mixin mixinof name object parent precedence slots subclasses superclasses variable variables vars" } # Index: tests/destroy.test =================================================================== diff -u -N -r75383021cb9f2f2db883583779a02eef6f1801f5 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/destroy.test (.../destroy.test) (revision 75383021cb9f2f2db883583779a02eef6f1801f5) +++ tests/destroy.test (.../destroy.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -702,7 +702,7 @@ ::nx::Object public method f1 args {next} ::nx::Object public method f2 args {next} - ::nx::Object filter set {f1 f2} + ::nx::Object filters set {f1 f2} set x [nx::Class new { :volatile @@ -721,7 +721,7 @@ ? [list info command $x] $x "destroy via volatile method + 2 filters" - ::nx::Object filter set "" + ::nx::Object filters set "" } nx::test case nested-ordered-composite { Index: tests/disposition.test =================================================================== diff -u -N -rcd7387dce218900697565aeabc0e58afb0294a6a -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/disposition.test (.../disposition.test) (revision cd7387dce218900697565aeabc0e58afb0294a6a) +++ tests/disposition.test (.../disposition.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -593,7 +593,7 @@ # effective difference between #activelevel and #callinglevel, both # skip INACTIVE frames. - Callee mixin set [Class new {:public method call args { next }}] + Callee mixins set [Class new {:public method call args { next }}] foreach dispoSpec { {-ah:alias,method=call {call:alias X}} @@ -963,7 +963,7 @@ } } - C mixin set M1 + C mixins set M1 # N+4 |:CscFrame @Type(ENSEMBLE) | <-- foo (leaf) # N+3 |:CscFrame @Call(ENSEMBLE) | <-- FOO (root) @@ -989,11 +989,11 @@ } "::c2--FOO foo--foo" # ... the filter variant ... - C mixin set {} + C mixins set {} C public method intercept args { next } - C filter set intercept + C filters set intercept # N+4 |:CscFrame @Type(ENSEMBLE) | <-- foo (leaf) # N+3 |:CscFrame @Call(ENSEMBLE) | <-- FOO (root) @@ -1018,7 +1018,7 @@ } "::c2--FOO foo--foo" - C filter set "" + C filters set "" # / / / / / / / / / / / / / / / / / / / / / / / / / / / / / # b) Between root and intermittent or inbetween the set of # intermittent frames (i.e., indirection at the level of @@ -1035,7 +1035,7 @@ } } - C::slot::__FOO object mixin set M2 + C::slot::__FOO object mixins set M2 ? {C::slot::__FOO foo} "::M2--::C::slot::__FOO--foo--foo" C::slot::__FOO eval {unset :msg} @@ -1045,11 +1045,11 @@ c1 eval {set :msg} } "::c1--FOO foo--foo" - C::slot::__FOO object mixin set {} + C::slot::__FOO object mixins set {} C::slot::__FOO public object method intercept {} { return "[current]--[next]" } - C::slot::__FOO object filter set intercept + C::slot::__FOO object filters set intercept ? {C::slot::__FOO foo} "::C::slot::__FOO--::C::slot::__FOO--foo--foo" C setObjectParams [list] @@ -1070,7 +1070,7 @@ } } - C mixin set M2 + C mixins set M2 # N+4 |:CscFrame @Type(ENSEMBLE) | <-- C.FOO.foo (leaf) # N+2 |:CscFrame @Call(ENSEMBLE) | <-- C.FOO (root) @@ -1085,7 +1085,7 @@ c1 eval {set :msg} } "(1)--::c1--FOO foo--foo--(3)--::M2--FOO foo--::c1" - C mixin set {} + C mixins set {} } nx::test case dispo-configure-transparency { @@ -1130,9 +1130,9 @@ } C setObjectParams [list [list FOO:alias,noarg ""]] - C mixin add M + C mixins add M ? {C create c} "::c-FOO" - C mixin set {} + C mixins set {} # ... at the called object level @@ -1150,7 +1150,7 @@ ? {C create c} "::c" "Defaultmethod of callee is invoked ..." C setObjectParams [list [list FOO:alias "foo"]] ? {C create c} "::callee-FOO foo" "foo leaf method is selected ..." - ::callee object mixin add M + ::callee object mixins add M ? {C create c} "::callee-FOO foo" "With mixin ..." # @@ -1220,7 +1220,7 @@ } - ::obj object mixin set UnknownHandler + ::obj object mixins set UnknownHandler ? {[T create t] z uff} "CURRENT-::obj-DELEGATOR-::t-UNKNOWNMETHOD-uff-PATH-z" \ "Aliased dispatch to unknown method (custom unknown handler)" set x [UnknownHandler create handledObj] @@ -1237,11 +1237,11 @@ # # a) direct dispatch (non-aliased) with fully qualified selector (::*) # - ::obj object mixin set {} + ::obj object mixins set {} T setObjectParams x:alias,method=::obj ? {T create t XXX} "::t: unable to dispatch method '::obj'" "FQ dispatch with default unknown handler" - ::T mixin set UnknownHandler + ::T mixins set UnknownHandler ? {T create t XXX} "UNKNOWNMETHOD-::obj" "FQ dispatch with custom unknown handler" # @@ -1250,7 +1250,7 @@ UnknownHandler method defaultmethod {} { set :defaultmethod 1 } - ::obj object mixin set UnknownHandler + ::obj object mixins set UnknownHandler T setObjectParams [list [list z:alias,noarg ""]] ? {T create t; ::obj eval {info exists :defaultmethod}} 1 \ "Calling defaultmethod via alias+noarg combo with empty default" @@ -1270,29 +1270,29 @@ # ? {T create t XXX} "invalid argument 'XXX', maybe too many arguments; should be \"::t configure ?/z/?\"" - ::obj object mixin set {} + ::obj object mixins set {} T setObjectParams [list z:alias] ? {T create tt YYY} "::obj: unable to dispatch method 'YYY'" "sending the msg: tt->z(::obj)->YYY()" - ::obj object mixin set UnknownHandler + ::obj object mixins set UnknownHandler ? {T create tt YYY} "CURRENT-::obj-DELEGATOR-::tt-UNKNOWNMETHOD-YYY-PATH-z" \ "sending the msg: tt->z(::obj)->YYY()" - ::obj object mixin set {} + ::obj object mixins set {} T setObjectParams [list -z:alias] ? {T create tt -z YYY} "::obj: unable to dispatch method 'YYY'" "sending the msg: tt->z(::obj)->YYY()" - ::obj object mixin set UnknownHandler + ::obj object mixins set UnknownHandler ? {T create tt -z YYY} "CURRENT-::obj-DELEGATOR-::tt-UNKNOWNMETHOD-YYY-PATH-z" \ "sending the msg: tt->z(::obj)->YYY()" # # [current methodpath] & empty selector strings: # - ::obj object mixin set {} + ::obj object mixins set {} T setObjectParams [list z:alias] ? {T create tt ""} "::obj: unable to dispatch method ''" "sending the msg: tt->z->{}()" - ::obj object mixin set UnknownHandler + ::obj object mixins set UnknownHandler ? {T create tt ""} "CURRENT-::obj-DELEGATOR-::tt-UNKNOWNMETHOD--PATH-z" "sending the msg: tt->z->{}()" T setObjectParams [list -z:alias] ? {T create tt -z ""} "CURRENT-::obj-DELEGATOR-::tt-UNKNOWNMETHOD--PATH-z" "sending the msg: tt->z()" @@ -1301,13 +1301,13 @@ # # Dispatch with a method handle # - ::T mixin set {} + ::T mixins set {} ? [list [T create t] $methods(z) XXX] \ "CURRENT-::obj-DELEGATOR-::t-UNKNOWNMETHOD-XXX-PATH-::nsf::classes::T::z" 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" - ::T mixin set UnknownHandler + ::T mixins set UnknownHandler ? {T create t XXX} "CURRENT-::obj-DELEGATOR-::t-UNKNOWNMETHOD-XXX-PATH-::nsf::classes::T::z" \ "Non-object FQ selector with custom unknown handler" @@ -1426,13 +1426,13 @@ # superclass in nx.tcl nx::Class create P - ? {P info superclass} ::nx::Object + ? {P info superclasses} ::nx::Object # # When we pass the superclass a different value, this is certainly used. # nx::Class create Q -superclass P - ? {Q info superclass} ::P + ? {Q info superclasses} ::P # # When we call configure on the superclass, we do not want the @@ -1441,7 +1441,7 @@ # only, when the object is not yet initialized. # Q configure - ? {Q info superclass} ::P + ? {Q info superclasses} ::P } Index: tests/forward.test =================================================================== diff -u -N -ra615b76dd389290567bc8506fec6fa0a3b2c14d2 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/forward.test (.../forward.test) (revision a615b76dd389290567bc8506fec6fa0a3b2c14d2) +++ tests/forward.test (.../forward.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -67,21 +67,21 @@ # mixin example ########################################### nx::test case mixin-via-forward { - nx::Object create mixin { + nx::Object create mixins { :object method unknown {m args} {return [concat [current] $m $args]} } nx::Object create obj { - :public object forward Mixin mixin %1 %self + :public object forward Mixin mixins %1 %self } - ? {obj Mixin add M1} [list ::mixin add ::obj M1] + ? {obj Mixin add M1} [list ::mixins add ::obj M1] ? {catch {obj Mixin}} 1 - obj public object forward Mixin mixin "%1 {Getter Setter}" %self - ? {obj Mixin add M1} [list ::mixin add ::obj M1] - ? {obj Mixin M1} [list ::mixin Setter ::obj M1] - ? {obj Mixin} [list ::mixin Getter ::obj] + obj public object forward Mixin mixins "%1 {Getter Setter}" %self + ? {obj Mixin add M1} [list ::mixins add ::obj M1] + ? {obj Mixin M1} [list ::mixins Setter ::obj M1] + ? {obj Mixin} [list ::mixins Getter ::obj] } @@ -452,22 +452,22 @@ ? [list set _ [namespace current]] ::NS ? [list set _ [NS create m1]] ::NS::m1 - NS filter set f + NS filters set f ? [list set _ [NS create m2]] ::NS::m2 - NS filter set "" + NS filters set "" namespace eval ::test { ? [list set _ [NS create m3]] ::test::m3 - NS filter set f + NS filters set f ? [list set _ [NS create m4]] ::test::m4 - NS filter set "" + NS filters set "" } namespace eval test { ? [list set _ [NS create m5]] ::NS::test::m5 - NS filter set f + NS filters set f ? [list set _ [NS create m6]] ::NS::test::m6 - NS filter set "" + NS filters set "" } } @@ -477,22 +477,22 @@ ? [list set _ [namespace current]] ::NS ? [list set _ [NS create i1]] ::NS::i1 - NS filter set f + NS filters set f ? [list set _ [NS create i2]] ::NS::i2 - NS filter set "" + NS filters set "" namespace eval ::test { ? [list set _ [NS create i3]] ::test::i3 - NS filter set f + NS filters set f ? [list set _ [NS create i4]] ::test::i4 - NS filter set "" + NS filters set "" } namespace eval test { ? [list set _ [NS create i5]] ::NS::test::i5 - NS filter set f + NS filters set f ? [list set _ [NS create i6]] ::NS::test::i6 - NS filter set "" + NS filters set "" } } @@ -505,17 +505,17 @@ #puts ==== ? [list set _ [NS create n1]] ::n1 - NS filter set f + NS filters set f ? [list set _ [NS create n2]] ::n2 - NS filter set "" + NS filters set "" #puts ==== namespace eval test { ? [list set _ [NS create n1]] ::test::n1 ? [list set _ [NS create n3]] ::test::n3 - NS filter set f + NS filters set f ? [list set _ [NS create n4]] ::test::n4 - NS filter set "" + NS filters set "" } } Index: tests/info-method.test =================================================================== diff -u -N -rc790d82b4b9e44e1d8e2a303e1d4931a91f049d8 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/info-method.test (.../info-method.test) (revision c790d82b4b9e44e1d8e2a303e1d4931a91f049d8) +++ tests/info-method.test (.../info-method.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -4,55 +4,55 @@ package require nx::test # -# Test info superclass with closure and patterns (with and without +# Test info superclasses with closure and patterns (with and without # wildcards, prefixed or not, success or not). # nx::test case info-superclass { nx::Class create C nx::Class create D -superclass C # no patterns - ? {D info superclass} "::C" - ? {D info superclass -closure} "::C ::nx::Object" + ? {D info superclasses} "::C" + ? {D info superclasses -closure} "::C ::nx::Object" # fully qualified pattern, no wild-card characters, success - ? {D info superclass ::C} "::C" - ? {D info superclass -closure ::C} "::C" + ? {D info superclasses ::C} "::C" + ? {D info superclasses -closure ::C} "::C" # unprefixed pattern, no wild-card characters, success - ? {D info superclass C} "::C" - ? {D info superclass -closure C} "::C" + ? {D info superclasses C} "::C" + ? {D info superclasses -closure C} "::C" # fully qualified pattern, no wild-card characters, no success - ? {D info superclass ::D} "" - ? {D info superclass -closure ::D} "" - ? {D info superclass ::Dx} "" - ? {D info superclass -closure ::Dx} "" + ? {D info superclasses ::D} "" + ? {D info superclasses -closure ::D} "" + ? {D info superclasses ::Dx} "" + ? {D info superclasses -closure ::Dx} "" # unprefixed pattern, no wild-card characters, no success - ? {D info superclass D} "" - ? {D info superclass -closure D} "" - ? {D info superclass Dx} "" - ? {D info superclass -closure Dx} "" + ? {D info superclasses D} "" + ? {D info superclasses -closure D} "" + ? {D info superclasses Dx} "" + ? {D info superclasses -closure Dx} "" # fully qualified pattern, wild-card characters, success - ? {D info superclass ::*} "::C" - ? {D info superclass -closure ::C*} "::C" - ? {D info superclass -closure ::*} "::C ::nx::Object" - ? {D info superclass -closure ::nx*} "::nx::Object" + ? {D info superclasses ::*} "::C" + ? {D info superclasses -closure ::C*} "::C" + ? {D info superclasses -closure ::*} "::C ::nx::Object" + ? {D info superclasses -closure ::nx*} "::nx::Object" # unprefixed pattern, wild-card characters, success - ? {D info superclass C*} "::C" - ? {D info superclass -closure *} "::C ::nx::Object" - ? {D info superclass -closure nx*} "::nx::Object" + ? {D info superclasses C*} "::C" + ? {D info superclasses -closure *} "::C ::nx::Object" + ? {D info superclasses -closure nx*} "::nx::Object" # fully qualified pattern, wild-card characters, no success - ? {D info superclass ::*D} "" - ? {D info superclass -closure ::*D} "" + ? {D info superclasses ::*D} "" + ? {D info superclasses -closure ::*D} "" # unprefixed pattern, wild-card characters, no success - ? {D info superclass C*x} "" - ? {D info superclass -closure C*x} "" + ? {D info superclasses C*x} "" + ? {D info superclasses -closure C*x} "" } # @@ -129,7 +129,7 @@ ? {::nx::Class info lookup methods -source application} "" set object_methods "cget configure contains copy delete destroy eval info move object private protected public require" - set class_methods "alias cget configure contains copy create delete destroy eval filter forward info method mixin move new object private property protected public require variable" + set class_methods "alias cget configure contains copy create delete destroy eval filters forward info method mixins move new object private property protected public require variable" ? {lsort [::nx::Object info lookup methods -source system]} $class_methods ? {lsort [::nx::Class info lookup methods -source system]} $class_methods @@ -364,7 +364,7 @@ ? {o info lookup methods bar} bar ? {o bar} Object.bar - o object mixin set ::nx::Class + o object mixins set ::nx::Class ? {o info precedence} "::nx::Class ::nx::Object" ? {o info lookup method bar} "::nsf::classes::nx::Class::bar" ? {o info lookup methods bar} bar @@ -389,69 +389,69 @@ ? {o info lookup methods create} "" ? {o info lookup methods configure} configure ? {o info lookup method configure} "::nsf::classes::nx::Object::configure" - ? {o object filter set f} "f" - ? {o object filter guard f { 1 == 1 }} "" + ? {o object filters set f} "f" + ? {o object filters guard f { 1 == 1 }} "" ? {o info object filter guard f} " 1 == 1 " - ? {o object filter guard f} " 1 == 1 " - o object filter set "" + ? {o object filters guard f} " 1 == 1 " + o object filters 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 set {f f2}} "f f2" + ? {Foo filters set {f f2}} "f f2" ? {Foo info filter methods} "f f2" - ? {Foo filter guard f {2 == 2}} "" + ? {Foo filters 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 set {}} "" + ? {Foo filters set {}} "" ? {Foo object method f args ::nx::next} "::Foo::f" ? {Foo object method f2 args ::nx::next} "::Foo::f2" - ? {Foo object filter set {f f2}} "f f2" + ? {Foo object filters set {f f2}} "f f2" ? {Foo info object filter methods} "f f2" - ? {Foo object filter guard f {2 == 2}} "" + ? {Foo object filters 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 set {}} "" + ? {Foo object filters set {}} "" Foo destroy nx::Class create Fly - o object mixin add Fly + o object mixins add Fly ? {o info object mixin classes} "::Fly ::nx::Class" - ? {o object mixin guard ::Fly {1}} "" + ? {o object mixins guard ::Fly {1}} "" ? {o info object mixin classes -guards} "{::Fly -guard 1} ::nx::Class" ? {o info object mixin classes -guards Fly} "{::Fly -guard 1}" - o object mixin delete ::Fly + o object mixins delete ::Fly ? {o info object mixin classes} "::nx::Class" nx::Class create Foo - Foo mixin add ::nx::Class - Foo mixin add Fly + Foo mixins add ::nx::Class + Foo mixins add Fly ? {Foo info mixin classes} "::Fly ::nx::Class" - ? {Foo mixin guard ::Fly {1}} "" + ? {Foo mixins guard ::Fly {1}} "" ? {Foo info mixin classes -guards} "{::Fly -guard 1} ::nx::Class" ? {Foo info mixin classes -guards Fly} "{::Fly -guard 1}" - Foo mixin delete ::Fly + Foo mixins delete ::Fly ? {Foo info mixin classes} "::nx::Class" - Foo object mixin add ::nx::Class - Foo object mixin add Fly + Foo object mixins add ::nx::Class + Foo object mixins add Fly ? {Foo info object mixin classes} "::Fly ::nx::Class" - ? {Foo object mixin guard ::Fly {1}} "" + ? {Foo object mixins guard ::Fly {1}} "" ? {Foo info object mixin classes -guards} "{::Fly -guard 1} ::nx::Class" ? {Foo info object mixin classes -guards Fly} "{::Fly -guard 1}" - Foo object mixin delete ::Fly + Foo object mixins delete ::Fly ? {Foo info object mixin classes} "::nx::Class" ? {Foo info lookup methods create} "create" ? {Foo info lookup method create} "::nsf::classes::nx::Class::create" - ? {o object mixin set ""} "" + ? {o object mixins set ""} "" } @@ -505,7 +505,7 @@ :create d1 } - ? {lsort [D info lookup slots]} "::D::per-object-slot::a2 ::nx::Class::slot::filter ::nx::Class::slot::mixin ::nx::Class::slot::superclasses ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin" + ? {lsort [D info lookup slots]} "::D::per-object-slot::a2 ::nx::Class::slot::filters ::nx::Class::slot::mixins ::nx::Class::slot::superclasses ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filters ::nx::Object::slot::object-mixins" ? {D info lookup slots superclasses} "::nx::Class::slot::superclasses" ? {D info lookup slots ::nx::Class::slot::superclasses} "::nx::Class::slot::superclasses" @@ -520,7 +520,7 @@ ? {C info heritage} "::nx::Object" ? {C info slots -closure -source application} "::C::slot::____C.x ::C::slot::a ::C::slot::b" ? {lsort [C info slots -closure]} \ - "::C::slot::____C.x ::C::slot::a ::C::slot::b ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin" + "::C::slot::____C.x ::C::slot::a ::C::slot::b ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filters ::nx::Object::slot::object-mixins" ? {C info slots} "::C::slot::____C.x ::C::slot::a ::C::slot::b" @@ -532,12 +532,12 @@ # Test patterns for "info slots" # Partial name, no metachars - ? {C info slots -closure object-mixin} "::nx::Object::slot::object-mixin" + ? {C info slots -closure object-mixins} "::nx::Object::slot::object-mixins" # Partial name with metachars - ? {C info slots -closure *in*} \ - "::nx::Object::slot::__initblock ::nx::Object::slot::object-mixin" + ? {lsort [C info slots -closure *in*]} \ + "::nx::Object::slot::__initblock ::nx::Object::slot::object-mixins" # Fully qualified name, no metachars - ? {C info slots -closure ::nx::Object::slot::object-mixin} "::nx::Object::slot::object-mixin" + ? {C info slots -closure ::nx::Object::slot::object-mixins} "::nx::Object::slot::object-mixins" # Fully qualified name, with metachars # The following command returns the same as "C info slots" ? {C info slots -closure ::C::*} "::C::slot::____C.x ::C::slot::a ::C::slot::b" @@ -547,12 +547,12 @@ # Test patterns for "info lookup slots" # Partial name, no metachars - ? {c1 info lookup slots object-mixin} "::nx::Object::slot::object-mixin" + ? {c1 info lookup slots object-mixins} "::nx::Object::slot::object-mixins" # Partial name with metachars - ? {c1 info lookup slots *in*} \ - "::nx::Object::slot::__initblock ::nx::Object::slot::object-mixin" + ? {lsort [c1 info lookup slots *in*]} \ + "::nx::Object::slot::__initblock ::nx::Object::slot::object-mixins" # Fully qualified name, no metachars - ? {c1 info lookup slots ::nx::Object::slot::object-mixin} "::nx::Object::slot::object-mixin" + ? {c1 info lookup slots ::nx::Object::slot::object-mixins} "::nx::Object::slot::object-mixins" # Fully qualified name, with metachars ? {c1 info lookup slots ::C::*} "::C::slot::____C.x ::C::slot::a ::C::slot::b" @@ -564,7 +564,7 @@ ? {d1 info precedence} "::D ::C ::nx::Object" ? {lsort [d1 info lookup slots]} \ - "::C::slot::____C.x ::C::slot::a ::D::slot::b ::D::slot::c ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin" + "::C::slot::____C.x ::C::slot::a ::D::slot::b ::D::slot::c ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filters ::nx::Object::slot::object-mixins" # Fully qualified name, with metachars @@ -718,23 +718,23 @@ } C new - ? {C info lookup syntax create} "/objectName/ ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {C info lookup syntax create} "/objectName/ ?-a /value/? ?-b /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" ? {C info lookup syntax create a} "?-a /value/?" - ? {C info lookup parameters create } "objectName -a {-b 1} -object-mixin:mixinreg,slot=::nx::Object::slot::object-mixin,slotset,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,slot=::nx::Object::slot::object-filter,slotset,0..n __initblock:cmd,optional,nodashalnum" + ? {C info lookup parameters create } "objectName -a {-b 1} -object-mixins:mixinreg,slot=::nx::Object::slot::object-mixins,slotset,method=object-mixin,0..n -object-filters:filterreg,slot=::nx::Object::slot::object-filters,slotset,method=object-filter,0..n -class:class,alias,method=::nsf::methods::object::class __initblock:cmd,optional,nodashalnum" - #? {C info parameter list} "-a -b -noinit -object-mixin -class -object-filter __initblock" + #? {C info parameter list} "-a -b -noinit -object-mixins -class -object-filters __initblock" #? {C info lookup args create} "methodName a b noinit object-mixin class object-filter __initblock" - ? {lsort [C info slots -closure]} "::C::slot::a ::C::slot::b ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin" + ? {lsort [C info slots -closure]} "::C::slot::a ::C::slot::b ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filters ::nx::Object::slot::object-mixins" ? {C info lookup parameters create b} "{-b 1}" ? {D info lookup parameters create b} "{-b 2}" ? {D info slots -closure b} "::D::slot::b" ? {D info slots -closure a} "::C::slot::a" ? {D info slots -closure class} "::nx::Object::slot::class" -# ? {D info parameter list} "-b -c -a -noinit -object-mixin -class -object-filter __initblock" -# ? {D info parameter names} "b c a noinit object-mixin class object-filter __initblock" +# ? {D info parameter list} "-b -c -a -noinit -object-mixins -object-filters -class __initblock" +# ? {D info parameter names} "b c a noinit object-mixins object-filters class __initblock" } # @@ -755,7 +755,7 @@ ? {lsort [::nx::Object info methods -path "*slot*"]} \ "{info lookup slots} {info object slots}" ? {lsort [::nx::Object info methods -path "*filter*"]} \ - "{info lookup filter} {info lookup filters} {info object filter guard} {info object filter methods} {object filter}" + "{info lookup filter} {info lookup filters} {info object filter guard} {info object filter methods} {object filters}" ::nx::Class create C { :public method "string length" {s} {puts length} @@ -803,7 +803,7 @@ ? {::nx::Class info method syntax method} \ "/cls/ method /name/ /arguments/ ?-checkalways? ?-returns /value/? /body/" # a forwarder to ::nsf::relation; definition comes via array ::nsf::parametersyntax - ? {::nx::Class info method syntax mixin} "/cls/ mixin ?/class .../?|?add /class/?|?delete /class/?" + ? {::nx::Class info method syntax mixins} "/cls/ mixins add /class/|clear|delete /class/|get|guard /expr/|set /class .../" ? {::nx::Class info method syntax ::nx::next} "/cls/ next ?/arguments/?" ? {::nx::Class info method syntax ::nsf::xotclnext} "/cls/ xotclnext ?--noArgs? ?/arg .../?" @@ -827,32 +827,32 @@ ? {M1 info heritage} "::nx::Object" ? {M2 info heritage} "::A ::nx::Object" - B mixin add M1 + B mixins add M1 ? {A info heritage} "::nx::Object" ? {B info heritage} "::M1 ::A ::nx::Object" ? {B info mixin classes -closure} "::M1" - B mixin set M2 + B mixins set M2 ? {A info heritage} "::nx::Object" ? {B info heritage} "::M2 ::A ::nx::Object" ? {B info mixin classes -closure} "::M2" - B mixin set A + B mixins set A ? {A info heritage} "::nx::Object" ? {B info heritage} "::A ::nx::Object" - B mixin set C + B mixins set C ? {A info heritage} "::nx::Object" ? {B info heritage} "::C ::A ::nx::Object" - B mixin set "" + B mixins set "" ? {BB info heritage} "::B ::A ::nx::Object" - BB mixin set CC + BB mixins set CC ? {BB info heritage} "::CC ::C ::B ::A ::nx::Object" - BB mixin set "" + BB mixins set "" ? {BB info heritage} "::B ::A ::nx::Object" } @@ -867,31 +867,31 @@ Class create D -superclass A # transitive case - C mixin set D - B mixin set C + C mixins set D + B mixins set C ? {C info heritage} "::D ::A ::O ::nx::Object" ? {D info heritage} "::A ::O ::nx::Object" ? {B info heritage} "::D ::C ::A ::O ::nx::Object" # reset - C mixin set "" - B mixin set "" + C mixins set "" + B mixins set "" ? {B info heritage} "::A ::O ::nx::Object" ? {C info heritage} "::A ::O ::nx::Object" ? {D info heritage} "::A ::O ::nx::Object" # transitve different order - B mixin set C - C mixin set D + B mixins set C + C mixins set D ? {B info heritage} "::D ::C ::A ::O ::nx::Object" ? {C info heritage} "::D ::A ::O ::nx::Object" ? {D info heritage} "::A ::O ::nx::Object" # reset - C mixin set "" - B mixin set "" + C mixins set "" + B mixins set "" ? {B info heritage} "::A ::O ::nx::Object" ? {C info heritage} "::A ::O ::nx::Object" ? {D info heritage} "::A ::O ::nx::Object" @@ -913,34 +913,34 @@ Class create M # circular case - ? {B mixin set C} "::C" - ? {C mixin get} "" + ? {B mixins set C} "::C" + ? {C mixins get} "" - #? {C mixin set B} "classes dependent on ::C contain a cycle" - #? {C mixin get} "" ;# make sure, the mixin list of C was reset + #? {C mixins set B} "classes dependent on ::C contain a cycle" + #? {C mixins get} "" ;# make sure, the mixin list of C was reset - ? {C mixin set B} "::B" - ? {C mixin get} "::B" + ? {C mixins set B} "::B" + ? {C mixins get} "::B" ? {B info heritage} "::C ::A ::O ::nx::Object" ? {C info heritage} "::B ::A ::O ::nx::Object" #? {C info heritage} "::A ::O ::nx::Object" ? {D info heritage} "::A ::O ::nx::Object" # reset - C mixin set "" - B mixin set "" + C mixins set "" + B mixins set "" ? {B info heritage} "::A ::O ::nx::Object" ? {C info heritage} "::A ::O ::nx::Object" ? {D info heritage} "::A ::O ::nx::Object" # indirect circular case - B mixin set C - ? {C mixin get} "" + B mixins set C + ? {C mixins get} "" - ? {C mixin set BB} "::BB" - #? {C mixin set BB} "classes dependent on ::C contain a cycle" - #? {C mixin get} "" + ? {C mixins set BB} "::BB" + #? {C mixins set BB} "classes dependent on ::C contain a cycle" + #? {C mixins get} "" ? {B info heritage} "::BB ::C ::A ::O ::nx::Object" ? {C info heritage} "::BB ::B ::A ::O ::nx::Object" @@ -949,33 +949,33 @@ ? {D info heritage} "::A ::O ::nx::Object" # reset - C mixin set "" - B mixin set "" + C mixins set "" + B mixins set "" ? {B info heritage} "::A ::O ::nx::Object" ? {C info heritage} "::A ::O ::nx::Object" ? {D info heritage} "::A ::O ::nx::Object" - ? {M3 mixin set B} ::B + ? {M3 mixins set B} ::B ? {A info heritage} "::O ::nx::Object" ? {B info heritage} "::A ::O ::nx::Object" ? {M3 info heritage} "::B ::A ::O ::nx::Object" - ? {A mixin set M3} "::M3" + ? {A mixins set M3} "::M3" ? {A info heritage} "::B ::M3 ::O ::nx::Object" ? {B info heritage} "::M3 ::A ::O ::nx::Object" - #? {A mixin set M3} "classes dependent on ::A contain a cycle" + #? {A mixins set M3} "classes dependent on ::A contain a cycle" #? {A info heritage} "::O ::nx::Object" #? {B info heritage} "::A ::O ::nx::Object" ? {M3 create m1} ::m1 ? {m1 info precedence} "::B ::A ::O ::M3 ::nx::Object" ? {M3 info heritage} "::B ::A ::O ::nx::Object" - ? {B mixin set M3} ::M3 + ? {B mixins set M3} ::M3 ? {B info heritage} "::M3 ::A ::O ::nx::Object" - #? {B mixin set M3} {classes dependent on ::B contain a cycle} + #? {B mixins set M3} {classes dependent on ::B contain a cycle} #? {B info heritage} "::A ::O ::nx::Object" } @@ -987,13 +987,13 @@ Class create MovementTest Class create MovementLog - Agent mixin set MovementTest + Agent mixins set MovementTest Agent create a1 ? {Agent info heritage} "::MovementTest ::nx::Object" ? {a1 info precedence} "::MovementTest ::Agent ::nx::Object" - a1 object mixin set {MovementTest MovementLog} + a1 object mixins set {MovementTest MovementLog} ? {Agent info heritage} "::MovementTest ::nx::Object" ? {a1 info precedence} "::MovementTest ::MovementLog ::Agent ::nx::Object" @@ -1016,17 +1016,17 @@ ? {b1 info precedence} "::B ::A ::nx::Object" ? {b1 info precedence ::M*} "" - A mixin set {M1 M2} + A mixins set {M1 M2} ? {B info heritage} "::M1 ::M2 ::A ::nx::Object" ? {b1 info precedence} "::M1 ::M2 ::B ::A ::nx::Object" ? {b1 info precedence ::M*} "::M1 ::M2" ? {b1 info precedence ::X*} "" - b1 object mixin set {M1 M1 M4} + b1 object mixins set {M1 M1 M4} ? {b1 info precedence} "::M1 ::M4 ::M2 ::B ::A ::nx::Object" ? {b1 info object mixin classes} "::M1 ::M4" - B mixin set {M3 M1 M1 M4} + B mixins set {M3 M1 M1 M4} ? {B info heritage} "::M3 ::M1 ::M4 ::M2 ::A ::nx::Object" ? {b1 info precedence} "::M1 ::M4 ::M3 ::M2 ::B ::A ::nx::Object" } @@ -1044,12 +1044,12 @@ ? {c1 info precedence} "::C ::nx::Object" # ::A is an implied class - c1 object mixin set B + c1 object mixins set B ? {c1 info precedence} "::B ::A ::C ::nx::Object" ? {c1 info lookup mixins} "::B ::A" # ::A is as well implied by ::PCM - C mixin set PCM + C mixins set PCM ? {C info heritage} "::PCM ::A ::nx::Object" ? {C info mixin classes} "::PCM" ? {C info mixin classes -order} "" ;# ???? why no warning @@ -1078,7 +1078,7 @@ ? {C info heritage} "::B ::A ::nx::Object" ? {c1 info precedence} "::C ::B ::A ::nx::Object" - B mixin set PCMB + B mixins set PCMB # heritage includes implied classes ? {C info heritage} "::PCMB ::PCMA ::B ::A ::nx::Object" @@ -1103,7 +1103,7 @@ # since C is a specialization of B, it inherits the classes from B ? {C info mixin classes -heritage} "::PCMB ::PCMA ::A" - PCMB mixin set TPCMB + PCMB mixins set TPCMB # heritage includes implied classes ? {C info heritage} "::TPCMB ::TPCMA ::PCMB ::PCMA ::B ::A ::nx::Object" @@ -1126,7 +1126,7 @@ # since C is a specialization of B, it inherits the classes from B ? {C info mixin classes -heritage} "::TPCMB ::TPCMA ::PCMB ::PCMA ::A" - C mixin set PCMC + C mixins set PCMC # heritage includes implied classes ? {C info heritage} "::PCMC ::TPCMB ::TPCMA ::PCMB ::PCMA ::B ::A ::nx::Object" @@ -1234,7 +1234,7 @@ ? {D info methods -closure *2} "d2 c2" ? {D info methods -closure -source application} "c1 d1 d2 c2" - D mixin set M + D mixins set M # # Check as well methods inherited from per-class mixins @@ -1249,7 +1249,7 @@ # nx::test case error-in-ensemble { ? {nx::Object info method definition foo 1} {wrong # args: should be "definition name"} - ? {nx::Object info subclass I R G H} {invalid argument 'R', maybe too many arguments; should be "::nx::Object info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {nx::Object info subclasses I R G H} {invalid argument 'R', maybe too many arguments; should be "::nx::Object info subclasses ?-closure? ?-dependent? ?/pattern/?"} } Index: tests/info-variable.test =================================================================== diff -u -N -r896f9013e125e965474ea7fdbda099ca22b152c2 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/info-variable.test (.../info-variable.test) (revision 896f9013e125e965474ea7fdbda099ca22b152c2) +++ tests/info-variable.test (.../info-variable.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -34,14 +34,14 @@ "objectName -age:integer -name --object-mixin:mixinreg,slot=::nx::Object::slot::object-mixin,slotset,0..n +-object-mixins:mixinreg,slot=::nx::Object::slot::object-mixins,slotset,method=object-mixin,0..n +-object-filters:filterreg,slot=::nx::Object::slot::object-filters,slotset,method=object-filter,0..n -class:class,alias,method=::nsf::methods::object::class --object-filter:filterreg,slot=::nx::Object::slot::object-filter,slotset,0..n __initblock:cmd,optional,nodashalnum" ? {Person info lookup parameters create age} "-age:integer" ? {Person info lookup parameters create {*a[gs]*}} "-age:integer -class:class,alias,method=::nsf::methods::object::class" - ? {Person info lookup syntax create} "/objectName/ ?-age /integer/? ?-name /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {Person info lookup syntax create} "/objectName/ ?-age /integer/? ?-name /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" ? {Person info method parameters foo} {-force:switch age:integer {name ""}} ? {Person info method parameters foo force} "-force:switch" @@ -76,11 +76,11 @@ } ? {lmap p [Foo info lookup parameters create] {nsf::parameter::info name $p}} \ - "objectName i a b p object-mixin class object-filter __initblock" + "objectName i a b p object-mixins object-filters class __initblock" ? {lmap p [Foo info lookup parameters create] {nsf::parameter::info default $p}} \ "0 0 0 1 1 0 0 0 0" ? {lmap p [Foo info lookup parameters create] {nsf::parameter::info type $p}} \ - "{} {} integer integer {} mixinreg class filterreg {}" + "{} {} integer integer {} mixinreg filterreg class {}" ? {join [lsort [::Foo info slots]] \n} \ "::Foo::slot::____Foo.p @@ -112,8 +112,8 @@ ::Foo::slot::q ::nx::Object::slot::__initblock ::nx::Object::slot::class -::nx::Object::slot::object-filter -::nx::Object::slot::object-mixin" +::nx::Object::slot::object-filters +::nx::Object::slot::object-mixins" # get the configure value from p and the value of the private property via m ? {f1 cget -p} 9 Index: tests/interceptor-slot.test =================================================================== diff -u -N -rd9344280c05990c0254aa652a08a09da3e5822b1 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/interceptor-slot.test (.../interceptor-slot.test) (revision d9344280c05990c0254aa652a08a09da3e5822b1) +++ tests/interceptor-slot.test (.../interceptor-slot.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -1,5 +1,4 @@ # -*- Tcl -*- -package require nx package require nx::test nx::Class create M { @@ -13,25 +12,25 @@ # test mixin method # nx::test case mixin-method { - ? {C info lookup method mixin} "::nsf::classes::nx::Class::mixin" - ? {C mixin set M} ::M + ? {C info lookup method mixins} "::nsf::classes::nx::Class::mixins" + ? {C mixins set M} ::M ? {C info precedence} "::nx::Class ::nx::Object" - ? {C mixin get} "::M" + ? {C mixins get} "::M" ? {C info mixin classes} "::M" ? {c1 info precedence} "::M ::C ::nx::Object" - ? {C mixin add M2} "::M2 ::M" + ? {C mixins add M2} "::M2 ::M" ? {c1 info precedence} "::M2 ::M ::C ::nx::Object" - ? {C mixin delete M2} "::M" + ? {C mixins delete M2} "::M" ? {c1 info precedence} "::M ::C ::nx::Object" - ? {C mixin delete M} "" + ? {C mixins delete M} "" ? {C info mixin classes} "" - ? {C mixin set ::M} "::M" - ? {C mixin clear} "::M" + ? {C mixins set ::M} "::M" + ? {C mixins clear} "::M" ? {C info mixin classes} "" - ? {C mixin add ::M} "::M" - ? {C mixin set {}} "" + ? {C mixins add ::M} "::M" + ? {C mixins set {}} "" ? {C info mixin classes} "" } @@ -50,26 +49,26 @@ # # per-object mixins # -nx::test case per-object-mixin { +nx::test case per-object-mixins { ? {c1 info precedence} "::C ::nx::Object" - ? {c1 object mixin add M} ::M + ? {c1 object mixins add M} ::M ? {::nsf::relation::get c1 object-mixin} ::M ? {catch {c1 object mixin UNKNOWN}} 1 ? {::nsf::relation::get c1 object-mixin} "::M" # add again the same mixin - ? {c1 object mixin add M} {::M} + ? {c1 object mixins add M} {::M} ? {c1 info precedence} "::M ::C ::nx::Object" - ? {c1 object mixin add M2} "::M2 ::M" + ? {c1 object mixins add M2} "::M2 ::M" ? {c1 info precedence} "::M2 ::M ::C ::nx::Object" - ? {c1 object mixin delete M} "::M2" + ? {c1 object mixins delete M} "::M2" ? {c1 info precedence} "::M2 ::C ::nx::Object" - ? {c1 object mixin delete M2} "" + ? {c1 object mixins delete M2} "" ? {c1 info precedence} "::C ::nx::Object" - ? {c1 object mixin add M} {::M} + ? {c1 object mixins add M} {::M} ? {c1 info object mixin classes} {::M} - ? {c1 object mixin clear} {::M} + ? {c1 object mixins clear} {::M} ? {c1 info object mixin classes} {} } @@ -100,36 +99,36 @@ # "mixin" # nx::test case class+mixin { - ? {C object mixin set M} ::M + ? {C object mixins set M} ::M ? {C info precedence} "::M ::nx::Class ::nx::Object" ? {C info object mixin classes} "::M" - ? {C object mixin set ""} "" + ? {C object mixins set ""} "" ? {C info precedence} "::nx::Class ::nx::Object" } # # add and remove object mixin for classes via object mixin add # nx::test case class+mixin-add { - ? {C object mixin add M} ::M + ? {C object mixins add M} ::M ? {C info precedence} "::M ::nx::Class ::nx::Object" ? {C info object mixin classes} "::M" - ? {C object mixin set ""} "" + ? {C object mixins set ""} "" ? {C info precedence} "::nx::Class ::nx::Object" - ? {C object mixin add M} ::M + ? {C object mixins add M} ::M ? {C info precedence} "::M ::nx::Class ::nx::Object" ? {::nsf::relation::get C object-mixin} ::M - ? {catch {C object mixin add UNKNOWN}} 1 + ? {catch {C object mixins add UNKNOWN}} 1 ? {::nsf::relation::get C object-mixin} "::M" - ? {C object mixin set ""} "" + ? {C object mixins set ""} "" ? {C info precedence} "::nx::Class ::nx::Object" - ? {C object mixin set M} ::M + ? {C object mixins set M} ::M ? {C info precedence} "::M ::nx::Class ::nx::Object" # forwarder with get - ? {C object mixin get} "::M" + ? {C object mixins get} "::M" } @@ -142,20 +141,20 @@ nx::Class create M11 nx::Class create C1 - ? {C1 info lookup method mixin} "::nsf::classes::nx::Class::mixin" - C1 object mixin set M1 + ? {C1 info lookup method mixins} "::nsf::classes::nx::Class::mixins" + C1 object mixins set M1 ? {C1 info precedence} "::M1 ::nx::Class ::nx::Object" C1 create c11 ? {c11 info precedence} "::C1 ::nx::Object" - C1 object mixin add M11 + C1 object mixins add M11 ? {C1 info precedence} "::M11 ::M1 ::nx::Class ::nx::Object" - Object create o -object-mixin M1 + Object create o -object-mixins M1 ? {o info precedence} "::M1 ::nx::Object" nx::Class create O - O object mixin set M1 + O object mixins set M1 ? {O info precedence} "::M1 ::nx::Class ::nx::Object" - nx::Class create O -object-mixin M1 + nx::Class create O -object-mixins M1 ? {O info precedence} "::M1 ::nx::Class ::nx::Object" } @@ -173,16 +172,16 @@ ? {cc info object filter methods} "" ? {::nsf::relation::set cc object-filter filterA} filterA ? {cc info object filter methods} "filterA" - ? {cc object filter set filterB} "filterB" + ? {cc object filters set filterB} "filterB" ? {::nsf::relation::get cc object-filter} "filterB" ? {cc info object filter methods} "filterB" - ? {cc object filter add filterD} "filterD filterB" + ? {cc object filters add filterD} "filterD filterB" ? {::nsf::relation::get cc object-filter} "filterD filterB" ? {cc info object filter methods} "filterD filterB" - ? {cc object filter delete filterB} "filterD" + ? {cc object filters delete filterB} "filterD" ? {::nsf::relation::get cc object-filter} "filterD" ? {cc info object filter methods} "filterD" @@ -196,7 +195,7 @@ ? {::nsf::relation::get CC object-filter} "filterC" ? {CC info object filter methods} "filterC" - ? {CC object filter clear} "filterC" + ? {CC object filters clear} "filterC" ? {::nsf::relation::get CC object-filter} "" ? {CC info object filter methods} "" @@ -206,19 +205,19 @@ ? {::nsf::relation::get CC class-filter} "filterA" ? {CC info filter methods} "filterA" - ? {CC filter add filterB} "filterB filterA" + ? {CC filters add filterB} "filterB filterA" ? {::nsf::relation::get CC class-filter} "filterB filterA" ? {CC info filter methods} "filterB filterA" - ? {CC filter delete filterA} "filterB" + ? {CC filters delete filterA} "filterB" ? {::nsf::relation::get CC class-filter} "filterB" ? {CC info filter methods} "filterB" ? {catch {::nsf::relation::set CC class-filter UNKNOWN}} 1 ? {::nsf::relation::get CC class-filter} "filterB" ? {CC info filter methods} "filterB" - ? {CC filter clear} "filterB" + ? {CC filters clear} "filterB" ? {::nsf::relation::get CC class-filter} "" ? {CC info filter methods} "" } @@ -259,7 +258,7 @@ ? {ob bar} {::ob: unable to dispatch method 'bar'} ? {ob baz} {} - Foo filter set myfilter + Foo filters set myfilter # create through filter ? {Foo create ob} ::ob @@ -278,7 +277,7 @@ ? {ob2 baz} {} # create with filter - ? {Foo create ob3 -object-filter myfilter} ::ob3 + ? {Foo create ob3 -object-filters myfilter} ::ob3 } @@ -345,7 +344,7 @@ nx::Class create Y {:public method foo {} {return "Y [next]"}} nx::Class create Z -superclass Y {:public method foo {} {return "Z [next]"}} - Z create c1 -object-mixin {C B A} + Z create c1 -object-mixins {C B A} ? {c1 foo} "C B A Z Y " ? {c1 [C info method definitionhandle foo]} "C B A Z Y " ? {c1 [B info method definitionhandle foo]} "B A Z Y " @@ -400,7 +399,7 @@ nx::Class create Y {:public method foo {} {return "Y [next]"}} nx::Class create Z -superclass Y {:public method foo {} {return "Z [next]"}} - Z create c1 -object-mixin {C B A} + Z create c1 -object-mixins {C B A} ? {c1 foo} "C B A Z Y " ? {nsf::dispatch c1 -intrinsic foo} "Z Y " @@ -466,7 +465,7 @@ # # ... and we register it. # - :filter add loggingFilter + :filters add loggingFilter } set ::_ {} @@ -484,7 +483,7 @@ # general since the can as well trigger on arbitrary patterns. # - Room filter guard loggingFilter { + Room filters guard loggingFilter { [current calledmethod] in {enter leave} } @@ -511,7 +510,7 @@ lappend ::dangerRoomLog [current calledmethod] next } - :filter add loggingFilter + :filters add loggingFilter } ? {DangerRoom create d} ::d @@ -553,7 +552,7 @@ # # ... and we register it together with a guard. # - :filter add {loggingFilter -guard { + :filters add {loggingFilter -guard { [current calledmethod] in {enter leave} }} } @@ -583,7 +582,7 @@ lappend ::dangerRoomLog [current calledmethod] next } - :filter add loggingFilter + :filters add loggingFilter } ? {DangerRoom create d} ::d @@ -610,18 +609,18 @@ nx::Class create C nx::Class create D -superclass C - D create d1 -object-mixin M1 + D create d1 -object-mixins M1 ? {d1 info lookup mixins} ::M1 - D mixin add {M2 -guard 1} + D mixins add {M2 -guard 1} ? {d1 info lookup mixins} "::M1 ::M2" - C mixin add M3 + C mixins add M3 ? {d1 info lookup mixins} "::M1 ::M2 ::M3" ? {d1 info lookup mixins -guards} "::M1 {::M2 -guard 1} ::M3" ? {d1 info lookup mixins -guards *2*} "{::M2 -guard 1}" - d1 object mixin clear + d1 object mixins clear ? {d1 info lookup mixins} "::M2 ::M3" } @@ -654,7 +653,7 @@ # Add spacy class as a mixin. Check, if the introspection returns # sensible values. - ? {C mixin add "M1 b"} "{::M1 b}" + ? {C mixins add "M1 b"} "{::M1 b}" ? {C info mixin classes} "{::M1 b}" ? {M1 info mixin classes} "" ? {M1 info mixinof} "" Index: tests/interp.test =================================================================== diff -u -N -r12319faaf20df7116346558bd948b0edda9124eb -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/interp.test (.../interp.test) (revision 12319faaf20df7116346558bd948b0edda9124eb) +++ tests/interp.test (.../interp.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -83,8 +83,8 @@ ? {interp eval $i {::C create ::c}} ::c # set some relationships to test later ... - ? {interp eval $i {::C mixin add ::M}} ::M - ? {interp eval $i {::C object mixin add ::M}} ::M + ? {interp eval $i {::C mixins add ::M}} ::M + ? {interp eval $i {::C object mixins add ::M}} ::M $i hide C ? {interp eval $i {::C create ::c2}} {invalid command name "::C"} @@ -660,7 +660,7 @@ return <[current class]>[next]<[current class]> } } - x object mixin set M + x object mixins set M } ? {$i eval {x foo}} <::M>OK<::M> @@ -692,8 +692,8 @@ $i hide MM M $i eval {nx::Class create ::M2} - ? {$i eval {x object mixin add M2}} {mixin: expected a class as mixin but got "::M"} - ? {$i invokehidden M mixin add M2} {expected object but got "::M" for parameter "object"} + ? {$i eval {x object mixins add M2}} {mixin: expected a class as mixin but got "::M"} + ? {$i invokehidden M mixins add M2} {expected object but got "::M" for parameter "object"} interp delete $i unset i @@ -712,15 +712,15 @@ nx::Class create M1 nx::Class create M2 nx::Class create M3 - o object mixin set {M1 M2} + o object mixins set {M1 M2} } ? {$i eval {o info precedence}} "::M1 ::M2 ::nx::Object" ? {$i eval {o info object mixin classes}} {::M1 ::M2} ? {$i hidden} "" $i hide M1 ? {$i hidden} M1 - $i eval {M2 mixin add M3} + $i eval {M2 mixins add M3} ? {$i eval {o info precedence}} "::M1 ::M3 ::M2 ::nx::Object" # # Now, have the mixin list invalidated; The next time we request the list, Index: tests/introspection.test =================================================================== diff -u -N -r4bc60e16c10fdbbb640b3019d4bdebdc469fdf55 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/introspection.test (.../introspection.test) (revision 4bc60e16c10fdbbb640b3019d4bdebdc469fdf55) +++ tests/introspection.test (.../introspection.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -43,7 +43,7 @@ return [list [current calledclass] [next]] } } - C mixin add M + C mixins add M ? {[C new] baz} {::C ::C} } @@ -62,7 +62,7 @@ Class create M set mh2 [M public method foo {} $body] - M filter add foo + M filters add foo o mixin M ? {o foo} [list $mh2 $mh {}] Index: tests/linearization.test =================================================================== diff -u -N -r4bc60e16c10fdbbb640b3019d4bdebdc469fdf55 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/linearization.test (.../linearization.test) (revision 4bc60e16c10fdbbb640b3019d4bdebdc469fdf55) +++ tests/linearization.test (.../linearization.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -4,7 +4,7 @@ set constraints "" foreach c [$obj info precedence] { - set sc [$c info superclass] + set sc [$c info superclasses] # add constraints to ensure that subclass is before superclass foreach super $sc { lappend constraints [list $c < $super] } @@ -57,7 +57,7 @@ foreach c [$obj info precedence] { # compute vor every class its subclasses - set subclasses [$c info subclass -closure] + set subclasses [$c info subclasses -closure] # subclasses must be before classes foreach sc $subclasses { Index: tests/method-parameter.test =================================================================== diff -u -N -rcd7387dce218900697565aeabc0e58afb0294a6a -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/method-parameter.test (.../method-parameter.test) (revision cd7387dce218900697565aeabc0e58afb0294a6a) +++ tests/method-parameter.test (.../method-parameter.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -107,9 +107,9 @@ nx::test case flag-in-ensemble { nx::Class create C - set info {info children, info class, info filter guard, info filter methods, 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 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 mixin classes, info mixin guard, info mixinof, info name, info object filter guard, info object filter methods, info object method args, info object method body, 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 mixin classes, info object mixin guard, info object slots, info object variables, info parent, info precedence, info slots, info subclass, info superclass, info variable definition, info variable name, info variable parameter, info variables, info vars} + set info {info children, info class, info filter guard, info filter methods, 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 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 mixin classes, info mixin guard, info mixinof, info name, info object filter guard, info object filter methods, info object method args, info object method body, 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 mixin classes, info object mixin guard, 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 superclass} "::nx::Object" + ? {C info superclasses} "::nx::Object" ? {C info -a superclass} "unable to dispatch sub-method \"-a\" of ::C info; valid are: $info" ? {C info -- superclass} "unable to dispatch sub-method \"--\" of ::C info; valid are: $info" ? {C info -- -a superclass} "unable to dispatch sub-method \"--\" of ::C info; valid are: $info" @@ -118,9 +118,9 @@ # -# Testing error messages in info subclass, when too many arguments are +# Testing error messages in info subclasses, when too many arguments are # specified, or when wrong non-positional arguments are given. The -# argument "pattern" in "info subclass" has parameter option +# argument "pattern" in "info subclasses" has parameter option # "nodashalnum" set. # @@ -132,104 +132,104 @@ # # no argument # - ? {C info subclass} "::E ::D" - ? {C info subclass --} "::E ::D" + ? {C info subclasses} "::E ::D" + ? {C info subclasses --} "::E ::D" # # one argument # - ? {C info subclass a} "" + ? {C info subclasses a} "" # # The argument definition of "pattern" for subclass has # "nodashalnum" option, therefore we can deduce that "-a" must be # a flag. OTOH, if "-a" is a proper value (e.g. value of a # variable), then the following command would be perfectly fine. # - ? {C info subclass -a} \ + ? {C info subclasses -a} \ {invalid non-positional argument '-a', valid are : -closure, -dependent; - should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass -a --} \ + ? {C info subclasses -a --} \ {invalid non-positional argument '-a', valid are : -closure, -dependent; - should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass -- -a} "" - ? {C info subclass -1} "" - ? {C info subclass -- -1} "" - ? {C info subclass -1 --} \ - {invalid argument '--', maybe too many arguments; should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {C info subclasses -- -a} "" + ? {C info subclasses -1} "" + ? {C info subclasses -- -1} "" + ? {C info subclasses -1 --} \ + {invalid argument '--', maybe too many arguments; should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} # # two arguments # - ? {C info subclass a b} \ - {invalid argument 'b', maybe too many arguments; should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {C info subclasses a b} \ + {invalid argument 'b', maybe too many arguments; should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass -- a b} \ - {invalid argument 'b', maybe too many arguments; should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {C info subclasses -- a b} \ + {invalid argument 'b', maybe too many arguments; should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass a -- b} \ - {invalid argument '--', maybe too many arguments; should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {C info subclasses a -- b} \ + {invalid argument '--', maybe too many arguments; should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass a b --} \ - {invalid argument 'b', maybe too many arguments; should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {C info subclasses a b --} \ + {invalid argument 'b', maybe too many arguments; should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} # first flag - ? {C info subclass -a b} \ + ? {C info subclasses -a b} \ {invalid non-positional argument '-a', valid are : -closure, -dependent; - should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass -- -a b} \ - {invalid argument 'b', maybe too many arguments; should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {C info subclasses -- -a b} \ + {invalid argument 'b', maybe too many arguments; should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass -a -- b} \ + ? {C info subclasses -a -- b} \ {invalid non-positional argument '-a', valid are : -closure, -dependent; - should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass -a b --} \ + ? {C info subclasses -a b --} \ {invalid non-positional argument '-a', valid are : -closure, -dependent; - should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} # second flag - ? {C info subclass a -b} \ - {invalid argument '-b', maybe too many arguments; should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {C info subclasses a -b} \ + {invalid argument '-b', maybe too many arguments; should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass -- a -b} \ - {invalid argument '-b', maybe too many arguments; should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {C info subclasses -- a -b} \ + {invalid argument '-b', maybe too many arguments; should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass a -- -b} \ - {invalid argument '--', maybe too many arguments; should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {C info subclasses a -- -b} \ + {invalid argument '--', maybe too many arguments; should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass a -b --} \ - {invalid argument '-b', maybe too many arguments; should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {C info subclasses a -b --} \ + {invalid argument '-b', maybe too many arguments; should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} # both flag - ? {C info subclass -a -b} \ + ? {C info subclasses -a -b} \ {invalid non-positional argument '-a', valid are : -closure, -dependent; - should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass -- -a -b} \ - {invalid argument '-b', maybe too many arguments; should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {C info subclasses -- -a -b} \ + {invalid argument '-b', maybe too many arguments; should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass -a -- -b} \ + ? {C info subclasses -a -- -b} \ {invalid non-positional argument '-a', valid are : -closure, -dependent; - should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass -a -b --} \ + ? {C info subclasses -a -b --} \ {invalid non-positional argument '-a', valid are : -closure, -dependent; - should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} } # -# Testing error messages in info superclass, when too many arguments +# Testing error messages in info superclasses, when too many arguments # are specified, or when wrong non-positional arguments are -# given. The argument "pattern" in "info superclass" has parameter option +# given. The argument "pattern" in "info superclasses" has parameter option # "nodashalnum" NOT set. # @@ -240,80 +240,80 @@ # # no argument # - ? {D info superclass} "::C" - ? {D info superclass --} "::C" + ? {D info superclasses} "::C" + ? {D info superclasses --} "::C" # # one argument # - ? {D info superclass a} "" + ? {D info superclasses a} "" # # The argument definition of "pattern" for superclass has no # "nodashalnum" option, "-a" is treated like a pattern. # - ? {D info superclass -a} "" - ? {D info superclass -a --} \ - {invalid argument '--', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} - ? {D info superclass -- -a} "" - ? {D info superclass -1} "" + ? {D info superclasses -a} "" + ? {D info superclasses -a --} \ + {invalid argument '--', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} + ? {D info superclasses -- -a} "" + ? {D info superclasses -1} "" # # two arguments # - ? {D info superclass a b} \ - {invalid argument 'b', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses a b} \ + {invalid argument 'b', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} - ? {D info superclass -- a b} \ - {invalid argument 'b', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses -- a b} \ + {invalid argument 'b', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} - ? {D info superclass a -- b} \ - {invalid argument '--', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses a -- b} \ + {invalid argument '--', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} - ? {D info superclass a b --} \ - {invalid argument 'b', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses a b --} \ + {invalid argument 'b', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} # first flag - ? {D info superclass -a b} \ - {invalid argument 'b', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses -a b} \ + {invalid argument 'b', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} - ? {D info superclass -- -a b} \ - {invalid argument 'b', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses -- -a b} \ + {invalid argument 'b', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} - ? {D info superclass -a -- b} \ - {invalid argument '--', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses -a -- b} \ + {invalid argument '--', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} - ? {D info superclass -a b --} \ - {invalid argument 'b', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses -a b --} \ + {invalid argument 'b', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} # second flag - ? {D info superclass a -b} \ - {invalid argument '-b', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses a -b} \ + {invalid argument '-b', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} - ? {D info superclass -- a -b} \ - {invalid argument '-b', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses -- a -b} \ + {invalid argument '-b', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} - ? {D info superclass a -- -b} \ - {invalid argument '--', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses a -- -b} \ + {invalid argument '--', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} - ? {D info superclass a -b --} \ - {invalid argument '-b', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses a -b --} \ + {invalid argument '-b', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} # both flag - ? {D info superclass -a -b} \ - {invalid argument '-b', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses -a -b} \ + {invalid argument '-b', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} - ? {D info superclass -- -a -b} \ - {invalid argument '-b', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses -- -a -b} \ + {invalid argument '-b', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} - ? {D info superclass -a -- -b} \ - {invalid argument '--', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses -a -- -b} \ + {invalid argument '--', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} - ? {D info superclass -a -b --} \ - {invalid argument '-b', maybe too many arguments; should be "::D info superclass ?-closure? ?/pattern/?"} + ? {D info superclasses -a -b --} \ + {invalid argument '-b', maybe too many arguments; should be "::D info superclasses ?-closure? ?/pattern/?"} } @@ -330,29 +330,29 @@ # # no argument # - ? {C info subclass} "::-a" - ? {C info subclass --} "::-a" + ? {C info subclasses} "::-a" + ? {C info subclasses --} "::-a" - ? {-b info superclass} "::-a" - ? {-b info superclass --} "::-a" + ? {-b info superclasses} "::-a" + ? {-b info superclasses --} "::-a" # # one argument # - ? {C info subclass -a} \ + ? {C info subclasses -a} \ {invalid non-positional argument '-a', valid are : -closure, -dependent; - should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass -a --} \ + ? {C info subclasses -a --} \ {invalid non-positional argument '-a', valid are : -closure, -dependent; - should be "::C info subclass ?-closure? ?-dependent? ?/pattern/?"} + should be "::C info subclasses ?-closure? ?-dependent? ?/pattern/?"} - ? {C info subclass -- -a} "::-a" + ? {C info subclasses -- -a} "::-a" - ? {-b info superclass -a} "::-a" - ? {-b info superclass -a --} \ - {invalid argument '--', maybe too many arguments; should be "::-b info superclass ?-closure? ?/pattern/?"} - ? {-b info superclass -- -a} "::-a" + ? {-b info superclasses -a} "::-a" + ? {-b info superclasses -a --} \ + {invalid argument '--', maybe too many arguments; should be "::-b info superclasses ?-closure? ?/pattern/?"} + ? {-b info superclasses -- -a} "::-a" } Index: tests/methods.test =================================================================== diff -u -N -r75383021cb9f2f2db883583779a02eef6f1801f5 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/methods.test (.../methods.test) (revision 75383021cb9f2f2db883583779a02eef6f1801f5) +++ tests/methods.test (.../methods.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -206,54 +206,55 @@ # register the mixin on C as a object mixin and define a mixinguard puts stderr XXXX=[nx::Class info method definition mixin] - C mixin set M - C mixin guard M {1 == 1} + C mixins set M + C mixins guard M {1 == 1} ? {C info mixin guard M} "1 == 1" - C mixin guard M {} + C mixins guard M {} ? {C info mixin guard M} "" # now the same as class mixin and class mixin guard - C object mixin set M - C object mixin guard M {1 == 1} + C object mixins set M + C object mixins guard M {1 == 1} ? {C info object mixin guard M} "1 == 1" - C object mixin guard M {} + C object mixins guard M {} ? {C info object mixin guard M} "" } nx::test case mixin-via-objectparam { # add an object and class mixin via object-parameter and via slots foreach c {M1 M2 M3 M4 M5} {nx::Class create $c} - nx::Class create C -mixin M1 -object-mixin M2 { - :mixin add M3 - :object mixin add M4 + nx::Class create C -mixin M1 -object-mixins M2 { + :mixins add M3 + :object mixins add M4 } ? {lsort [C info object mixin classes]} "::M2 ::M4" ? {lsort [C info mixin classes]} "::M1 ::M3" - ? {lsort [C object mixin get]} "::M2 ::M4" - ? {lsort [C mixin get]} "::M1 ::M3" + ? {lsort [C object mixins get]} "::M2 ::M4" + ? {lsort [C mixins get]} "::M1 ::M3" - ? {lsort [C object mixin]} {wrong # args: use "::C object mixin add|clear|delete|get|guard|set"} - ? {lsort [C mixin]} {wrong # args: use "::C mixin add|clear|delete|get|guard|set"} + ? {lsort [C object mixins]} {wrong # args: use "::C object mixins add|clear|delete|get|guard|set"} + ? {lsort [C mixins]} {wrong # args: use "::C mixins add|clear|delete|get|guard|set"} + ? {lsort [C mixins x]} {submethod x undefined for mixins: use "::C mixins add|clear|delete|get|guard|set"} ? {catch {C mixin M5} errorMsg} 1 ? {lsort [C info mixin classes]} "::M1 ::M3" ? {catch {C object mixin M5} errorMsg} 1 ? {lsort [C info object mixin classes]} "::M2 ::M4" - ? {C mixin set M5} ::M5 + ? {C mixins set M5} ::M5 ? {lsort [C info mixin classes]} "::M5" - ? {C object mixin set M5} "::M5" + ? {C object mixins set M5} "::M5" ? {lsort [C info object mixin classes]} "::M5" ? {C configure -mixin M1} "" ? {C cget -mixin} "::M1" - ? {C configure -object-mixin M2} "" + ? {C configure -object-mixins M2} "" ? {C cget -object-mixin} "::M2" } @@ -273,7 +274,7 @@ } } - o object mixin set M + o object mixins set M ? {o bar -x 13 -y 14} "x 13 y 14 {-x 13 -y 14} -- x 13 y 14 {-x 13 -y 14}" ? {o bar -y 14 -x 13} "x 13 y 14 {-y 14 -x 13} -- x 13 y 14 {-y 14 -x 13}" } @@ -1185,7 +1186,7 @@ ? {c1 foo} 1 ? {c1 bar} 2 - db object mixin set Profile + db object mixins set Profile ? {c1 foo} 1 ? {c1 bar} 2 @@ -1249,7 +1250,7 @@ ? bar0 2 ? bar 2 - ns_cache object mixin set Profile + ns_cache object mixins set Profile # the version with tcl-uplevel should fail ? bar0 {can't read "x": no such variable} Index: tests/mixinof.test =================================================================== diff -u -N -rb337116e984a18da8696cc53b8b32eae0b4842df -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/mixinof.test (.../mixinof.test) (revision b337116e984a18da8696cc53b8b32eae0b4842df) +++ tests/mixinof.test (.../mixinof.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -11,9 +11,9 @@ nx::test case simple-pom { nx::Class create A - nx::Object create o -object-mixin A + nx::Object create o -object-mixins A - ? {o object mixin get} ::A + ? {o object mixins get} ::A ? {o info object mixin classes} ::A ? {A info mixinof} ::o @@ -30,10 +30,10 @@ nx::Class create C -superclass B nx::Class create M - B mixin set M + B mixins set M - nx::Object create o -object-mixin C - nx::Object create o1 -object-mixin B + nx::Object create o -object-mixins C + nx::Object create o1 -object-mixins B ? {C info mixinof} ::o @@ -54,7 +54,7 @@ nx::test case recreate-mixin-class { nx::Class create M {:method foo args {puts x;next}} - nx::Object create o -object-mixin M + nx::Object create o -object-mixins M ? {o info object mixin classes} ::M ? {o info precedence} "::M ::nx::Object" @@ -81,7 +81,7 @@ nx::Class create C -superclass B C create c1 - ? {B mixin get} ::A + ? {B mixins get} ::A ? {B info mixin classes} ::A ? {A info mixinof} ::B ? {c1 info precedence} "::A ::C ::B ::nx::Object" @@ -100,7 +100,7 @@ nx::Class create M2 nx::Class create X nx::Class create A -mixin {M1 M2 X} - A mixin guard M1 "test" + A mixins guard M1 "test" nx::Class create B -superclass A ? {A info mixin classes M2} ::M2 @@ -123,13 +123,13 @@ nx::Class create A nx::Class create B -mixin A nx::Class create C -superclass B - A mixin set [nx::Class create M] + A mixins set [nx::Class create M] A create a1 B create b1 C create c1 - ? {B mixin get} ::A + ? {B mixins get} ::A ? {B info mixin classes} ::A ? {A info mixinof -scope class} ::B ? {a1 info precedence} "::M ::A ::nx::Object" @@ -178,7 +178,7 @@ ? {B info mixinof -scope class -closure} "" ? {X info mixinof -scope class -closure} "" - D mixin set X + D mixins set X ? {C info mixinof -scope class -closure} "::A ::B" ? {D info mixinof -scope class -closure} "::A ::B" ? {A info mixinof -scope class -closure} "" @@ -198,8 +198,8 @@ nx::Class create B3 -superclass [nx::Class create B2 -superclass [nx::Class create B1 -superclass [nx::Class create B0]]] nx::Class create C3 -superclass [nx::Class create C2 -superclass [nx::Class create C1]] - A2 mixin set B2 - B1 mixin set C2 + A2 mixins set B2 + B1 mixins set C2 ? {A1 info mixinof -scope class -closure} "" ? {A2 info mixinof -scope class -closure} "" @@ -232,7 +232,7 @@ B create b1 C create c1 - ? {B mixin get} ::A + ? {B mixins get} ::A ? {B info mixin classes} ::A ? {A info mixinof -scope class} ::B ? {a1 info precedence} "::M ::A ::nx::Object" @@ -266,7 +266,7 @@ B create b1 C create c1 - ? {B mixin get} ::A + ? {B mixins get} ::A ? {B info mixin classes} ::A ? {A info mixinof -scope class} ::B ? {a1 info precedence} "::M ::A ::nx::Object" @@ -293,22 +293,22 @@ nx::Class create C -superclass B C create c1 - ? {B mixin get} ::A + ? {B mixins get} ::A ? {B info mixin classes} ::A ? {A info mixinof -scope class} ::B ? {c1 info precedence} "::A ::C ::B ::nx::Object" - ? {B info superclass -closure} "::nx::Object" - ? {C info superclass -closure} "::B ::nx::Object" + ? {B info superclasses -closure} "::nx::Object" + ? {C info superclasses -closure} "::B ::nx::Object" ? {B info heritage} "::A ::nx::Object" ? {C info heritage} "::A ::B ::nx::Object" nx::Class create B -mixin A - ? {B info superclass -closure} "::nx::Object" - ? {C info superclass -closure} "::nx::Object" + ? {B info superclasses -closure} "::nx::Object" + ? {C info superclasses -closure} "::nx::Object" ? {B info heritage} "::A ::nx::Object" ? {C info heritage} "::nx::Object" - ? {B mixin get} ::A + ? {B mixins get} ::A ? {B info mixin classes} ::A ? {A info mixinof} ::B ? {c1 info precedence} "::C ::nx::Object" @@ -330,19 +330,19 @@ nx::Class create C -superclass B C create c1 - ? {B mixin get} ::A + ? {B mixins get} ::A ? {B info mixin classes} ::A ? {A info mixinof -scope class} ::B ? {c1 info precedence} "::A ::C ::B ::nx::Object" - ? {B info superclass -closure} "::nx::Object" - ? {C info superclass -closure} "::B ::nx::Object" + ? {B info superclasses -closure} "::nx::Object" + ? {C info superclasses -closure} "::B ::nx::Object" ? {B info heritage} "::A ::nx::Object" ? {C info heritage} "::A ::B ::nx::Object" nx::Class create B -mixin A - ? {B info superclass -closure} "::nx::Object" - ? {C info superclass -closure} "::B ::nx::Object" + ? {B info superclasses -closure} "::nx::Object" + ? {C info superclasses -closure} "::B ::nx::Object" ? {B info heritage} "::A ::nx::Object" ? {C info heritage} "::A ::B ::nx::Object" ? {B info mixin classes} ::A @@ -370,10 +370,10 @@ A create a1 O create o1 - ? {A info superclass} "::O" + ? {A info superclasses} "::O" ? {B info heritage} "::A ::O ::nx::Object" - ? {list [A info subclass] [B info subclass] [O info subclass]} "::B {} ::A" - ? {list [A info superclass] [B info superclass] [O info superclass]} "::O ::A ::nx::Object" + ? {list [A info subclasses] [B info subclasses] [O info subclasses]} "::B {} ::A" + ? {list [A info superclasses] [B info superclasses] [O info superclasses]} "::O ::A ::nx::Object" ? {list [a1 info class] [b1 info class] [o1 info class]} "::A ::B ::O" ? {o1 info precedence} "::O ::nx::Object" @@ -383,10 +383,10 @@ # we recreate the class new, with the same superclass nx::Class create A -superclass O - ? {A info superclass} "::O" + ? {A info superclasses} "::O" ? {B info heritage} "::nx::Object" - ? {list [A info subclass] [B info subclass] [O info subclass]} "{} {} ::A" - ? {list [A info superclass] [B info superclass] [O info superclass]} "::O ::nx::Object ::nx::Object" + ? {list [A info subclasses] [B info subclasses] [O info subclasses]} "{} {} ::A" + ? {list [A info superclasses] [B info superclasses] [O info superclasses]} "::O ::nx::Object ::nx::Object" ? {list [a1 info class] [b1 info class] [o1 info class]} "::nx::Object ::B ::O" ? {o1 info precedence} "::O ::nx::Object" ? {a1 info precedence} "::nx::Object" @@ -407,11 +407,11 @@ A create a1 O create o1 - ? {A info superclass} "::O" + ? {A info superclasses} "::O" ? {B info heritage} "::A ::O ::nx::Object" - ? {list [A info subclass] [B info subclass] [O info subclass]} "::B {} ::A" - ? {list [A info superclass] [B info superclass] [O info superclass]} "::O ::A ::nx::Object" + ? {list [A info subclasses] [B info subclasses] [O info subclasses]} "::B {} ::A" + ? {list [A info superclasses] [B info superclasses] [O info superclasses]} "::O ::A ::nx::Object" ? {list [a1 info class] [b1 info class] [o1 info class]} "::A ::B ::O" ? {o1 info precedence} "::O ::nx::Object" @@ -422,11 +422,11 @@ nx::Class create A - ? {A info superclass} "::nx::Object" + ? {A info superclasses} "::nx::Object" ? {B info heritage} "::nx::Object" - ? {list [A info subclass] [B info subclass] [O info subclass]} "{} {} {}" - ? {list [A info superclass] [B info superclass] [O info superclass]} "::nx::Object ::nx::Object ::nx::Object" + ? {list [A info subclasses] [B info subclasses] [O info subclasses]} "{} {} {}" + ? {list [A info superclasses] [B info superclasses] [O info superclasses]} "::nx::Object ::nx::Object ::nx::Object" ? {list [a1 info class] [b1 info class] [o1 info class]} "::nx::Object ::B ::O" ? {o1 info precedence} "::O ::nx::Object" @@ -450,11 +450,11 @@ A create a1 O create o1 - ? {A info superclass} "::O" + ? {A info superclasses} "::O" ? {B info heritage} "::A ::O ::nx::Object" - ? {list [A info subclass] [B info subclass] [O info subclass]} "::B {} ::A" - ? {list [A info superclass] [B info superclass] [O info superclass]} "::O ::A ::nx::Object" + ? {list [A info subclasses] [B info subclasses] [O info subclasses]} "::B {} ::A" + ? {list [A info superclasses] [B info superclasses] [O info superclasses]} "::O ::A ::nx::Object" ? {list [a1 info class] [b1 info class] [o1 info class]} "::A ::B ::O" ? {o1 info precedence} "::O ::nx::Object" @@ -465,11 +465,11 @@ nx::Class create A -superclass O - ? {A info superclass} "::O" + ? {A info superclasses} "::O" ? {B info heritage} "::A ::O ::nx::Object" - ? {list [A info subclass] [B info subclass] [O info subclass]} "::B {} ::A" - ? {list [A info superclass] [B info superclass] [O info superclass]} "::O ::A ::nx::Object" + ? {list [A info subclasses] [B info subclasses] [O info subclasses]} "::B {} ::A" + ? {list [A info superclasses] [B info superclasses] [O info superclasses]} "::O ::A ::nx::Object" ? {list [a1 info class] [b1 info class] [o1 info class]} "::A ::B ::O" ? {o1 info precedence} "::O ::nx::Object" @@ -493,8 +493,8 @@ ? {B info heritage} "::A ::O ::nx::Object" - ? {list [A info subclass] [B info subclass] [O info subclass]} "::B {} ::A" - ? {list [A info superclass] [B info superclass] [O info superclass]} "::O ::A ::nx::Object" + ? {list [A info subclasses] [B info subclasses] [O info subclasses]} "::B {} ::A" + ? {list [A info superclasses] [B info superclasses] [O info superclasses]} "::O ::A ::nx::Object" ? {list [a1 info class] [b1 info class] [o1 info class]} "::A ::B ::O" ? {o1 info precedence} "::O ::nx::Object" @@ -505,12 +505,12 @@ nx::Class create A - ? {A info superclass} "::nx::Object" + ? {A info superclasses} "::nx::Object" ? {B info heritage} "::A ::nx::Object" ? {B info heritage} "::A ::nx::Object" - ? {list [A info subclass] [B info subclass] [O info subclass]} "::B {} {}" - ? {list [A info superclass] [B info superclass] [O info superclass]} "::nx::Object ::A ::nx::Object" + ? {list [A info subclasses] [B info subclasses] [O info subclasses]} "::B {} {}" + ? {list [A info superclasses] [B info superclasses] [O info superclasses]} "::nx::Object ::A ::nx::Object" ? {list [a1 info class] [b1 info class] [o1 info class]} "::A ::B ::O" ? {o1 info precedence} "::O ::nx::Object" @@ -525,16 +525,16 @@ nx::Class create M nx::Class create A nx::Class create C - C create c1 -object-mixin A + C create c1 -object-mixins A C create c2 nx::Class create C2 -mixin A C2 create c22 - ? {c1 object mixin get} ::A + ? {c1 object mixins get} ::A ? {c1 info object mixin classes} ::A ? {lsort [A info mixinof]} "::C2 ::c1" ? {M info mixinof} "" - C mixin set M + C mixins set M #? {M info mixinof -scope object} "::c1 ::c2" ? {M info mixinof -scope object} "" ? {M info mixinof -scope class} "::C" Index: tests/nsf-cmd.test =================================================================== diff -u -N -r896f9013e125e965474ea7fdbda099ca22b152c2 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/nsf-cmd.test (.../nsf-cmd.test) (revision 896f9013e125e965474ea7fdbda099ca22b152c2) +++ tests/nsf-cmd.test (.../nsf-cmd.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -200,13 +200,13 @@ # configure # ? {nsf::cmd::info syntax -context p1 $::handle1} \ - "?-name /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + "?-name /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" ? {nsf::cmd::info parameter -context p1 $::handle1} \ - "-name -object-mixin:mixinreg,slot=::nx::Object::slot::object-mixin,slotset,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,slot=::nx::Object::slot::object-filter,slotset,0..n __initblock:cmd,optional,nodashalnum" + "-name -object-mixins:mixinreg,slot=::nx::Object::slot::object-mixins,slotset,method=object-mixin,0..n -object-filters:filterreg,slot=::nx::Object::slot::object-filters,slotset,method=object-filter,0..n -class:class,alias,method=::nsf::methods::object::class __initblock:cmd,optional,nodashalnum" ? {nsf::cmd::info args -context p1 $::handle1} \ - "name object-mixin class object-filter __initblock" + "name object-mixins object-filters class __initblock" # # filter on (virtual) arguments @@ -224,24 +224,24 @@ # create # ? {nsf::cmd::info syntax -context Person $::handle2} \ - "/objectName/ ?-name /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + "/objectName/ ?-name /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" ? {nsf::cmd::info parameter -context Person $::handle2} \ - "objectName -name -object-mixin:mixinreg,slot=::nx::Object::slot::object-mixin,slotset,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,slot=::nx::Object::slot::object-filter,slotset,0..n __initblock:cmd,optional,nodashalnum" + "objectName -name -object-mixins:mixinreg,slot=::nx::Object::slot::object-mixins,slotset,method=object-mixin,0..n -object-filters:filterreg,slot=::nx::Object::slot::object-filters,slotset,method=object-filter,0..n -class:class,alias,method=::nsf::methods::object::class __initblock:cmd,optional,nodashalnum" ? {nsf::cmd::info args -context Person $::handle2} \ - "objectName name object-mixin class object-filter __initblock" + "objectName name object-mixins object-filters class __initblock" # # new # ? {nsf::cmd::info syntax -context Person $::handle3} \ - "?-childof /value/? ?-name /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + "?-childof /value/? ?-name /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" ? {nsf::cmd::info parameter -context Person $::handle3} \ - "-childof -name -object-mixin:mixinreg,slot=::nx::Object::slot::object-mixin,slotset,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,slot=::nx::Object::slot::object-filter,slotset,0..n __initblock:cmd,optional,nodashalnum" + "-childof -name -object-mixins:mixinreg,slot=::nx::Object::slot::object-mixins,slotset,method=object-mixin,0..n -object-filters:filterreg,slot=::nx::Object::slot::object-filters,slotset,method=object-filter,0..n -class:class,alias,method=::nsf::methods::object::class __initblock:cmd,optional,nodashalnum" ? {nsf::cmd::info args -context Person $::handle3} \ - "-childof name object-mixin class object-filter __initblock" + "-childof name object-mixins object-filters class __initblock" # # filter on (virtual) arguments @@ -254,7 +254,7 @@ ? {nsf::cmd::info args -context Person $::handle3 *a*} "name class" ? {nsf::cmd::info syntax -context Person $::handle3 *a*} "?-name /value/? ?-class /class/?" - ? {nsf::cmd::info args -context Person $::handle3 *il*} "-childof object-filter" + ? {nsf::cmd::info args -context Person $::handle3 *il*} "-childof object-filters" # @@ -275,7 +275,7 @@ set ::handle4 [Student info lookup method create] ? {nsf::cmd::info syntax -context Student $::handle4} \ - "/objectName/ ?-matnr /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + "/objectName/ ?-matnr /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" } # Index: tests/object-system.test =================================================================== diff -u -N -r2f793442bb2a7860acc5620811dcafddc43074d3 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/object-system.test (.../object-system.test) (revision 2f793442bb2a7860acc5620811dcafddc43074d3) +++ tests/object-system.test (.../object-system.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -25,13 +25,13 @@ ? {::nsf::object::property nx::Object initialized} 1 ? {::nsf::is class nx::Object} 1 ? {::nsf::is metaclass nx::Object} 0 -? {nx::Object info superclass} "" +? {nx::Object info superclasses} "" ? {nx::Object info class} ::nx::Class ? {::nsf::object::exists nx::Class} 1 ? {::nsf::is class nx::Class} 1 ? {::nsf::is metaclass nx::Class} 1 -? {nx::Class info superclass} ::nx::Object +? {nx::Class info superclasses} ::nx::Object ? {nx::Class info class} ::nx::Class # @@ -97,22 +97,22 @@ nx::Class create C0 ? {::nsf::is class C0} 1 ? {::nsf::is metaclass C0} 0 -? {C0 info superclass} ::nx::Object +? {C0 info superclasses} ::nx::Object ? {C0 info class} ::nx::Class #? {lsort [Class info vars]} "__default_metaclass __default_superclass" nx::Class create M -superclass ::nx::Class ? {::nsf::object::exists M} 1 ? {::nsf::is class M} 1 ? {::nsf::is metaclass M} 1 -? {M info superclass} ::nx::Class +? {M info superclasses} ::nx::Class ? {M info class} ::nx::Class M create C ? {::nsf::object::exists C} 1 ? {::nsf::is class C} 1 ? {::nsf::is metaclass C} 0 -? {C info superclass} ::nx::Object +? {C info superclasses} ::nx::Object ? {C info class} ::M C create c1 @@ -125,11 +125,11 @@ ? {::nsf::object::exists M2} 1 ? {::nsf::is class M2} 1 ? {::nsf::is metaclass M2} 1 -? {M2 info superclass} ::M +? {M2 info superclasses} ::M ? {M2 info class} ::nx::Class M2 create m2 -? {m2 info superclass} ::nx::Object +? {m2 info superclasses} ::nx::Object ? {m2 info class} ::M2 # destroy meta-class M, reclass meta-class instances to the base @@ -138,12 +138,12 @@ ? {::nsf::object::exists C} 1 ? {::nsf::is class C} 1 ? {::nsf::is metaclass C} 0 -? {C info superclass} ::nx::Object +? {C info superclasses} ::nx::Object ? {C info class} ::nx::Class ? {::nsf::is metaclass M2} 1 -? {M2 info superclass} ::nx::Class -? {m2 info superclass} ::nx::Object +? {M2 info superclasses} ::nx::Class +? {m2 info superclasses} ::nx::Object ? {m2 info class} ::M2 Index: tests/parameters.test =================================================================== diff -u -N -rc790d82b4b9e44e1d8e2a303e1d4931a91f049d8 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/parameters.test (.../parameters.test) (revision c790d82b4b9e44e1d8e2a303e1d4931a91f049d8) +++ tests/parameters.test (.../parameters.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -4,12 +4,12 @@ #::nx::configure defaultMethodCallProtection false -set objectFilter "-object-filter:filterreg,slot=::nx::Object::slot::object-filter,slotset,0..n" -set objectMixin "-object-mixin:mixinreg,slot=::nx::Object::slot::object-mixin,slotset,0..n" +set objectFilter "-object-filters:filterreg,slot=::nx::Object::slot::object-filters,slotset,method=object-filter,0..n" +set objectMixin "-object-mixins:mixinreg,slot=::nx::Object::slot::object-mixins,slotset,method=object-mixin,0..n" set initBlock "__initblock:cmd,optional,nodashalnum" -set filter "-filter:filterreg,slot=::nx::Class::slot::filter,slotset,method=class-filter,0..n" +set filter "-filters:filterreg,slot=::nx::Class::slot::filters,slotset,method=class-filter,0..n" -set ::trailer "$objectMixin -class:class,alias,method=::nsf::methods::object::class $objectFilter $initBlock" +set ::trailer "$objectMixin $objectFilter -class:class,alias,method=::nsf::methods::object::class $initBlock" nx::test case dummy { @@ -52,7 +52,7 @@ } C create c1 nx::Class create M - c1 object mixin set M + c1 object mixins set M ? {::nsf::object::exists o1} 1 ? {::nsf::object::exists o1000} 0 @@ -283,7 +283,7 @@ C create c1 ? {C eval :__object_configureparameter} \ - "{-superclasses:class,alias,method=::nsf::methods::class::superclass,1..n ::nx::Object} -mixin:mixinreg,slot=::nx::Class::slot::mixin,slotset,method=class-mixin,0..n $::filter $::objectMixin -class:class,alias,method=::nsf::methods::object::class $::objectFilter $::initBlock" + "-mixins:mixinreg,slot=::nx::Class::slot::mixins,slotset,method=class-mixin,0..n {-superclasses:class,alias,method=::nsf::methods::class::superclass,1..n ::nx::Object} -filters:filterreg,slot=::nx::Class::slot::filters,slotset,method=class-filter,0..n -object-mixins:mixinreg,slot=::nx::Object::slot::object-mixins,slotset,method=object-mixin,0..n -object-filters:filterreg,slot=::nx::Object::slot::object-filters,slotset,method=object-filter,0..n -class:class,alias,method=::nsf::methods::object::class __initblock:cmd,optional,nodashalnum" #### TOOD: remove or add #? {c1 eval :__object_configureparameter} \ @@ -341,28 +341,28 @@ nx::Class create M2 { :property b2 } - D mixin set M + D mixins set M ? {d1 eval :__object_configureparameter} \ "-b -m1 -m2 -d:required -a {-c 1} $::trailer" \ "mixin added" - M mixin set M2 + M mixins set M2 ? {d1 eval :__object_configureparameter} \ "-b2 -b -m1 -m2 -d:required -a {-c 1} $::trailer" \ "transitive mixin added" - D mixin set "" + D mixins set "" #we should have again the old interface ? {d1 eval :__object_configureparameter} \ "-d:required -a -b:boolean {-c 1} $::trailer" - C mixin set M + C mixins set M ? {d1 eval :__object_configureparameter} \ "-b2 -b -m1 -m2 -d:required -a {-c 1} $::trailer" \ "mixin added" - C mixin set "" + C mixins set "" #we should have again the old interface ? {d1 eval :__object_configureparameter} \ @@ -388,7 +388,7 @@ ? {D create d1} \ {required argument 'd' is missing, should be: - ::d1 configure -d /value/ ?-a /value/? ?-b /boolean/? ?-c /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ::d1 configure -d /value/ ?-a /value/? ?-b /boolean/? ?-c /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?} ? {D create d2 -d x -b a} \ {expected boolean but got "a" for parameter "-b"} \ @@ -798,11 +798,11 @@ nx::Class create M nx::Class create M2 D create d1 -d 1 - C create c1 -object-mixin M - C create c2 -object-mixin {{M -guard true}} - C create c3 -object-mixin {M ::M2} - C create c4 -object-mixin {{M -guard 1} M2} - C create c5 -object-mixin {M {M2 -guard 2}} + C create c1 -object-mixins M + C create c2 -object-mixins {{M -guard true}} + C create c3 -object-mixins {M ::M2} + C create c4 -object-mixins {{M -guard 1} M2} + C create c5 -object-mixins {M {M2 -guard 2}} nx::Object create o ? {c1 info object mixin classes} ::M @@ -984,7 +984,7 @@ MC create MC1 nx::Class create M D create d1 -d 1 - C create c1 -object-mixin M + C create c1 -object-mixins M nx::Object create o nx::Class create ParamTest { @@ -1717,7 +1717,7 @@ set ::_ "" ? {C create c2} \ "required argument 'x' is missing, should be: - ::c2 configure -x /value/ -y /value/ ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ::c2 configure -x /value/ -y /value/ ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" # Was the constructor called? Should not. ? {set ::_} "" @@ -1740,11 +1740,11 @@ D property x:required ? {d1 info lookup syntax configure} \ - "-x /value/ ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + "-x /value/ ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" ? {d1 configure} \ "required argument 'x' is missing, should be: - ::d1 configure -x /value/ ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ::d1 configure -x /value/ ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" ? {d1 configure -x 123} "" ? {d1 cget -x} 123 @@ -1925,7 +1925,7 @@ ? {c1 eval :__object_configureparameter} "-a1 $::trailer" - c1 object mixin set M1 + c1 object mixins set M1 ? {c1 info precedence} "::M1 ::C ::nx::Object" @@ -1947,10 +1947,10 @@ # ? {c1 configure -a1 x} \ "required argument 'b1' is missing, should be: - ::c1 configure -b1 /value/ ?-a1 /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ::c1 configure -b1 /value/ ?-a1 /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" # - # The object parameter based on the per-object-mixin must not be + # The object parameter based on the per-object-mixins must not be # stored in the class based cache. Therefore, creating a new object # must not require b1 @@ -1972,7 +1972,7 @@ # # add one more mixin. # - c1 object mixin add ::M2 + c1 object mixins add ::M2 ? {c1 info object mixin classes} {::M2 ::M1} ? {c1 cget -object-mixin} {::M2 ::M1} ? {c1 info lookup parameters configure b1} "-b1:required" @@ -1982,14 +1982,14 @@ # # drop the mixins, the b* properties should be gone. # - c1 object mixin set "" + c1 object mixins set "" ? {c1 info object mixin classes} {} ? {lsort [c1 info lookup parameters configure b*]} "" # # add M1 again # - c1 object mixin add ::M1 + c1 object mixins add ::M1 ? {c1 info object mixin classes} {::M1} ? {c1 info lookup parameters configure b1} "-b1:required" ? {lsort [c1 info lookup parameters configure b*]} "-b1:required" @@ -2023,12 +2023,12 @@ nx::Class create D -superclass C nx::Class create M {:property b1:required} - c1 object mixin set M + c1 object mixins set M ? {c1 info precedence} "::M ::C ::nx::Object" - ? {C info slots -closure} \ - "::C::slot::a1 ::nx::Object::slot::__initblock ::nx::Object::slot::object-mixin ::nx::Object::slot::class ::nx::Object::slot::object-filter" + ? {lsort [C info slots -closure]} \ + "::C::slot::a1 ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filters ::nx::Object::slot::object-mixins" ? {c1 eval :__object_configureparameter} \ "-a2 -b1:required -a1 $::trailer" @@ -2041,11 +2041,11 @@ ? {c1 __configure -a1 x} \ "required argument 'b1' is missing, should be: - ::c1 configure ?-a2 /value/? -b1 /value/ ?-a1 /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ::c1 configure ?-a2 /value/? -b1 /value/ ?-a1 /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" ? {c1 info precedence} "::M ::C ::nx::Object" - ? {C info slots -closure} \ - "::C::slot::a1 ::nx::Object::slot::__initblock ::nx::Object::slot::object-mixin ::nx::Object::slot::class ::nx::Object::slot::object-filter" + ? {lsort [C info slots -closure]} \ + "::C::slot::a1 ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filters ::nx::Object::slot::object-mixins" ? {c1 eval :__object_configureparameter} "-a2 -b1:required -a1 $::trailer" # should not require b1 @@ -2340,7 +2340,7 @@ # ? {C info parameter list a} "-a" ? {C info lookup parameters create a} "{-a a0}" # ? {C info lookup syntax create a} "?-a /value/?" - ? {C info lookup syntax create} "/objectName/ ?-a /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {C info lookup syntax create} "/objectName/ ?-a /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?" ? {C info lookup parameters create v} "" ? {[C info slots v] definition} "::C variable -accessor none v v0" @@ -2349,8 +2349,8 @@ ? {C create c2 -a 10} ::c2 ? {C create c2 -v 10} \ - {invalid non-positional argument '-v', valid are : -a, -object-mixin, -class, -object-filter; - should be "::c2 configure ?-a /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?"} + {invalid non-positional argument '-v', valid are : -a, -object-mixins, -object-filters, -class; + should be "::c2 configure ?-a /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?"} # # We expect a setter for "a" but not for "v". Index: tests/plain-object-method.test =================================================================== diff -u -N -r23b10a2c736cf33731b0d7b0381314ddec44f2d6 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/plain-object-method.test (.../plain-object-method.test) (revision 23b10a2c736cf33731b0d7b0381314ddec44f2d6) +++ tests/plain-object-method.test (.../plain-object-method.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -7,8 +7,8 @@ ? {o public method foo {} {return foo}} "::o: unable to dispatch method 'method'" :public object method f args {next} } - ? {o mixin set M1} "::o: unable to dispatch method 'mixin'" - ? {o filter set f} "::o: unable to dispatch method 'filter'" + ? {o mixins set M1} "::o: unable to dispatch method 'mixins'" + ? {o filters set f} "::o: unable to dispatch method 'filters'" ? {lsort [o info object methods]} "f" ? {lsort [o info]} "valid submethods of ::o info: children class has info lookup name object parent precedence variable vars" @@ -49,14 +49,14 @@ ? {o a} "pm1" ? {o fwd} "pm1" - ? {o mixin set M1} ::M1 + ? {o mixins set M1} ::M1 ? {o info mixin classes} ::M1 - ? {o mixin set ""} "" + ? {o mixins set ""} "" ? {o info mixin classes} "" - ? {o filter set f} f + ? {o filters set f} f ? {o info filter methods} f - ? {o filter set ""} "" + ? {o filters set ""} "" ? {o info filter methods} "" ? {lsort [o info object methods]} "a f foo fwd p v2" Index: tests/properties.test =================================================================== diff -u -N -rc790d82b4b9e44e1d8e2a303e1d4931a91f049d8 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/properties.test (.../properties.test) (revision c790d82b4b9e44e1d8e2a303e1d4931a91f049d8) +++ tests/properties.test (.../properties.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -41,7 +41,7 @@ # # just the public properties are accessible via the configure interface # - ? {c1 info lookup syntax configure} {?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info lookup syntax configure} {?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?} ? {lsort [C info slots]} "::C::slot::____C.d ::C::slot::____C.vd ::C::slot::a ::C::slot::b ::C::slot::c ::C::slot::e ::C::slot::va ::C::slot::vb ::C::slot::vc ::C::slot::ve ::C::slot::vf" @@ -235,7 +235,7 @@ # # The use of "-incremental" implies multivalued # - ? {c1 info lookup syntax configure} {?-e /value .../? ?-a /value .../? ?-b /value .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info lookup syntax configure} {?-e /value .../? ?-a /value .../? ?-b /value .../? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?} ? {c1 cget -a} a1 ? {c1 cget -b} b1 @@ -410,7 +410,7 @@ # just the public properties are accessible via the configure interface # - ? {o1 info lookup syntax configure} {?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {o1 info lookup syntax configure} {?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?} # # just the public properties are accessible via the cget interface @@ -538,7 +538,7 @@ # # The use of "-incremental" implies multivalued # - ? {o1 info lookup syntax configure} {?-e /value .../? ?-a /value .../? ?-b /value .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {o1 info lookup syntax configure} {?-e /value .../? ?-a /value .../? ?-b /value .../? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?} ? {o1 cget -a} a1 ? {o1 cget -b} b1 @@ -759,12 +759,12 @@ # just the public properties are accessible via the configure interface # - ? {c1 info lookup syntax configure} {?-a /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info lookup syntax configure} {?-a /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?} ? {c1 cget -a} a1 ? {c1 configure -a a2} "" - ? {C info lookup syntax configure} {?-b /value/? ?-superclasses /class .../? ?-mixin /mixinreg .../? ?-filter /filterreg .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {C info lookup syntax configure} {?-b /value/? ?-mixins /mixinreg .../? ?-superclasses /class .../? ?-filters /filterreg .../? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?} ? {C cget -b} b1 ? {C configure -b b2} "" @@ -819,7 +819,7 @@ # package require nx::volatile - ? {c1 info lookup syntax configure} {?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info lookup syntax configure} {?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?} set e [C eval :__object_configureparameter] ? {C eval :__object_configureparameter} $e @@ -838,7 +838,7 @@ # # check influence of class-level per-object properties # - ? {d1 info lookup syntax configure} {?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {d1 info lookup syntax configure} {?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?} set e [D eval :__object_configureparameter] ? {D eval :__object_configureparameter} $e @@ -878,7 +878,7 @@ # just the public properties are accessible via the configure interface # - ? {o1 info lookup syntax configure} {?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {o1 info lookup syntax configure} {?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixins /mixinreg .../? ?-object-filters /filterreg .../? ?-class /class/? ?/__initblock/?} set e [o1 eval :__object_configureparameter] @@ -994,12 +994,12 @@ Foo property y ? {llength [Bar info lookup parameters create]} 5 - Bar mixin add Foo + Bar mixins add Foo ? {llength [Bar info lookup parameters create]} 6 ? {bar configure -y 1} "" ? {llength [Baz info lookup parameters create]} 5 - Baz mixin add Bar + Baz mixins add Bar ? {llength [Baz info lookup parameters create]} 6 Foo property z @@ -1026,7 +1026,7 @@ M2 create m2 ? {lmap p [C info lookup parameters create] {nsf::parameter::info name $p}} \ - "objectName object-mixin class object-filter __initblock" + "objectName object-mixins object-filters class __initblock" set base [llength [lmap p [C info lookup parameters create] {nsf::parameter::info name $p}]] ? [list set _ $base] 5 @@ -1049,13 +1049,13 @@ ? {c1 info precedence} "::C ::nx::Object" ? {d1 info precedence} "::D ::C ::nx::Object" - ? {C info subclass -dependent} "::C ::D" - ? {C info subclass -closure} "::C ::D" - ? {M0 info subclass -dependent} "::M0 ::M1 ::M2" - ? {M0 info subclass -closure} "::M0 ::M1 ::M2" + ? {C info subclasses -dependent} "::C ::D" + ? {C info subclasses -closure} "::C ::D" + ? {M0 info subclasses -dependent} "::M0 ::M1 ::M2" + ? {M0 info subclasses -closure} "::M0 ::M1 ::M2" #puts stderr =========C-mixin-add-M2 - C mixin add M2 + C mixins add M2 #puts stderr ========= ? {c1 foo} M @@ -1067,10 +1067,10 @@ ? {C info heritage} "::M2 ::M1 ::M0 ::nx::Object" ? {D info heritage} "::M2 ::M1 ::M0 ::C ::nx::Object" - ? {C info subclass -dependent} "::C ::D" - ? {C info subclass -closure} "::C ::D" - ? {M0 info subclass -dependent} "::M0 ::M1 ::M2 ::C ::D" - ? {M0 info subclass -closure} "::M0 ::M1 ::M2" + ? {C info subclasses -dependent} "::C ::D" + ? {C info subclasses -closure} "::C ::D" + ? {M0 info subclasses -dependent} "::M0 ::M1 ::M2 ::C ::D" + ? {M0 info subclasses -closure} "::M0 ::M1 ::M2" # Only M2 is a direct mixin, visible through "mixinof", @@ -1086,7 +1086,7 @@ ? {M0 info mixinof -closure} "::C ::D" ? {lmap p [C info lookup parameters create] {nsf::parameter::info name $p}} \ - "objectName x object-mixin class object-filter __initblock" + "objectName x object-mixins object-filters class __initblock" ? {llength [C info lookup parameters create]} [expr {$base + 1}] ? {llength [D info lookup parameters create]} [expr {$base + 1}] @@ -1099,13 +1099,13 @@ #::nsf::parameter::cache::classinvalidate ::C ? {lmap p [C info lookup parameters create] {nsf::parameter::info name $p}} \ - "objectName y x object-mixin class object-filter __initblock" + "objectName y x object-mixins object-filters class __initblock" ? {lmap p [M0 info lookup parameters create] {nsf::parameter::info name $p}} \ - "objectName x object-mixin class object-filter __initblock" + "objectName x object-mixins object-filters class __initblock" ? {lmap p [M1 info lookup parameters create] {nsf::parameter::info name $p}} \ - "objectName y x object-mixin class object-filter __initblock" + "objectName y x object-mixins object-filters class __initblock" ? {llength [C info lookup parameters create]} [expr {$base + 2}] ? {llength [D info lookup parameters create]} [expr {$base + 2}] @@ -1115,7 +1115,7 @@ # clearning the mixin has to reset the orders of the instances of C and D #puts stderr =========C-mixin-clear - C mixin clear + C mixins clear #puts stderr ========= ? {c1 foo} C Index: tests/protected.test =================================================================== diff -u -N -rc52c4d07b0c6921e5a94baa31e905ae21241eb25 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/protected.test (.../protected.test) (revision c52c4d07b0c6921e5a94baa31e905ae21241eb25) +++ tests/protected.test (.../protected.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -93,11 +93,11 @@ ? {c1 foo} foo # add a protected filter - c1 object filter add f1 + c1 object filters add f1 ? {c1 foo} foo # add a private filter - c1 object filter add f2 + c1 object filters add f2 ? {c1 foo} foo } @@ -191,7 +191,7 @@ # Behavior with mixin . THe private helper methods are "invisible" # for invocation and next path. - B mixin add M + B mixins add M ? {b1 bar} "B.bar " ? {b1 baz} "b1.baz B.baz " @@ -248,7 +248,7 @@ :public method bar {} {return "M.bar [next]"} :public method baz {} {return "M.baz [next]"} } - B mixin add M + B mixins add M ? {b1 bar} "M.bar B.bar " ? {b1 baz} "M.baz B.baz " @@ -280,13 +280,13 @@ # add a filter; be sure that we still can call the private -local # method - d1 object filter add f1 + d1 object filters add f1 ? {d1 baz} "f1 D.baz C.baz " ? {d1 foo} "f1 C.foo f1 bar" ? {d1 bar} "::d1: unable to dispatch method 'bar'" # remove the filter - d1 object filter set "" + d1 object filters set "" # define call to private method via method handle C public method foo {} { return "C.foo [[self] [C info method registrationhandle bar]]"} @@ -296,7 +296,7 @@ ? {d1 bar} "::d1: unable to dispatch method 'bar'" # add a filter; be sure that we still can call the private method - d1 object filter add f1 + d1 object filters add f1 ? {d1 baz} "f1 D.baz C.baz " ? {d1 foo} "f1 C.foo f1 bar" ? {d1 bar} "::d1: unable to dispatch method 'bar'" @@ -429,7 +429,7 @@ ? {o1 bar} o1 ? {o1 foo2} o1 - o1 object mixin add M + o1 object mixins add M ? {o1 foo} "M o1" ? {o1 bar} "o1" @@ -559,7 +559,7 @@ :public method foo {a b} {: -local baz $a $b} } - b1 object mixin add Mix + b1 object mixins add Mix # we can call Mix.baz only through Mix.foo ? {b1 foo 4 5} 1024 @@ -597,7 +597,7 @@ ? {s1 bar 4 5} 20 # add per-class mixin - Sub mixin add Mix + Sub mixins add Mix # foo is shadowed in the mixin and calls the mixin-private method ? {s1 foo 4 5} 1024 Index: tests/submethods.test =================================================================== diff -u -N -r82750874ad31c6874830319beb2ff6c3b862859a -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/submethods.test (.../submethods.test) (revision 82750874ad31c6874830319beb2ff6c3b862859a) +++ tests/submethods.test (.../submethods.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -1,5 +1,4 @@ # -*- Tcl -*- -package req nx package require nx::test ::nx::configure defaultMethodCallProtection false @@ -8,8 +7,8 @@ # test, whether error message from a submethod contains method path # nx::test case info-errors { - ? {::nx::Object info subclass a b c} \ - {invalid argument 'b', maybe too many arguments; should be "::nx::Object info subclass ?-closure? ?-dependent? ?/pattern/?"} + ? {::nx::Object info subclasses a b c} \ + {invalid argument 'b', maybe too many arguments; should be "::nx::Object info subclasses ?-closure? ?-dependent? ?/pattern/?"} ? {::nx::Object info object mixin classes a b c} \ {invalid argument 'b', maybe too many arguments; should be "::nx::Object info object mixin classes ?-guards? ?/pattern/?"} } @@ -171,7 +170,7 @@ } } - FOO mixin set {M1 M0} + FOO mixins set {M1 M0} FOO create f1 # @@ -209,7 +208,7 @@ return [::nsf::current methodpath] } } - nx::Object mixin add M + nx::Object mixins add M nx::Object create o1 # call a submethod defined by a mixin, which does a next @@ -290,7 +289,7 @@ :method "e2 e2 e2" {} {next 4} :method "e1 e1 e1" args {next {e1 e1 e1}} } - o object mixin add M + o object mixins add M # case without ensemble ? {o foo} 1 @@ -367,7 +366,7 @@ :public object method intercept args { incr :x; next; # a "filter next" } - :object filter set intercept + :object filters set intercept :FOO bar # Rationale: A call count > 2 would indicate that the leaf next # triggers a further call into filter ... @@ -403,19 +402,19 @@ C create c ? {c FOO foo} -::c-::C- - C mixin set [Class create M1 { + C mixins set [Class create M1 { :public method "FOO foo" {} { return "-[current]-[current class][next]" } }] ? {c FOO foo} -::c-::M1-::c-::C- - o object mixin set ::M1 + o object mixins set ::M1 ? {o FOO foo} -::o-::M1-::o-- - o object mixin set {} - C mixin set {} + o object mixins set {} + C mixins set {} # # limit [current methodpath] to collect only ensemble methods? @@ -521,7 +520,7 @@ set c [Z new] - Z filter set intercept + Z filters set intercept foreach selector [list "FOO foo" "BAR BUU boo" "baz"] { Z public method $selector {} {;} @@ -531,7 +530,7 @@ ? [list set _ [join [Z cget -msg] -]] -$root-::Z-$mh } - Z filter set {} + Z filters set {} } Index: tests/tcloo.test =================================================================== diff -u -N -r4bc60e16c10fdbbb640b3019d4bdebdc469fdf55 -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/tcloo.test (.../tcloo.test) (revision 4bc60e16c10fdbbb640b3019d4bdebdc469fdf55) +++ tests/tcloo.test (.../tcloo.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -82,7 +82,7 @@ ::nsf::next } } -nx::Class mixin add ExportUnexportUtil +nx::Class mixins add ExportUnexportUtil nx::test case export { # Index: tests/varresolution.test =================================================================== diff -u -N -r3cbf24ff95e38976cdc905ec0e8014d9d754ad6f -r275da34d3d7a874a451eced58242b738c8a37d1a --- tests/varresolution.test (.../varresolution.test) (revision 3cbf24ff95e38976cdc905ec0e8014d9d754ad6f) +++ tests/varresolution.test (.../varresolution.test) (revision 275da34d3d7a874a451eced58242b738c8a37d1a) @@ -722,10 +722,10 @@ nx::Class create M1 nx::Class create M2 - C mixin set M1 + C mixins set M1 ? {::nsf::relation::get C class-mixin} "::module::M1" - C mixin add M2 + C mixins add M2 ? {::nsf::relation::get C class-mixin} "::module::M2 ::module::M1" } @@ -1128,7 +1128,7 @@ return $package_id } - FormPage mixin add WorkflowPage + FormPage mixins add WorkflowPage FormPage create p1 -package_id 123 ? {p1 initialize_loaded_object} 123