Index: TODO =================================================================== diff -u -re0419345b49587b5738f87c6d828dfc5ae4b3276 -r3be87f20ac5f89fac33e2db3b95e80c9adfc92d9 --- TODO (.../TODO) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) +++ TODO (.../TODO) (revision 3be87f20ac5f89fac33e2db3b95e80c9adfc92d9) @@ -4574,25 +4574,24 @@ instead of o1 info lookup configure syntax -- traits: added ability to trun on verbosity for traits +- traits: added ability to turn on verbosity for traits by using nx::configure trait-verbosity on|off nx.tcl: - renamed variable option "-config" to "-configurable" to make its intention clearer +- changed multiplicity of mixin, object-mixin, filter, object-filter + from 1..n to 0..n; rationale: when one has a list of eg. mixins, + which should be passed, one has to test for the length before + passing it, otherwise the empty list would generate an error. + Allowing 0..n makes the usage simpler and the program shorter. + ======================================================================== TODO: -- reconsider - #? {c1 cget -mixin} "" - ? {c1 cget -object-mixin} "" - -- reconsider lower multiplicity on - -object-mixin, -mixin... - - handling of "required" in reconfigure (see parameter-object-mixin-dependency in parameters.test) - handling of recreate (see regression test for class-level properties) Index: library/nx/nx.tcl =================================================================== diff -u -re0419345b49587b5738f87c6d828dfc5ae4b3276 -r3be87f20ac5f89fac33e2db3b95e80c9adfc92d9 --- library/nx/nx.tcl (.../nx.tcl) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) +++ library/nx/nx.tcl (.../nx.tcl) (revision 3be87f20ac5f89fac33e2db3b95e80c9adfc92d9) @@ -1539,19 +1539,19 @@ # filter ::nx::RelationSlot create ::nx::Object::slot::object-mixin \ - -multiplicity 1..n \ + -multiplicity 0..n \ -methodname "::nx::Object::slot::__object::mixin" \ -settername "object mixin" -forwardername object-mixin -elementtype mixinreg ::nx::RelationSlot create ::nx::Object::slot::object-filter \ -methodname "::nx::Object::slot::__object::filter" \ - -multiplicity 1..n \ + -multiplicity 0..n \ -settername "object filter" -forwardername object-filter -elementtype filterreg ::nx::RelationSlot create ::nx::Class::slot::mixin \ - -multiplicity 1..n \ + -multiplicity 0..n \ -forwardername class-mixin -elementtype mixinreg ::nx::RelationSlot create ::nx::Class::slot::filter \ - -multiplicity 1..n \ + -multiplicity 0..n \ -forwardername class-filter -elementtype filterreg # Index: tests/info-method.test =================================================================== diff -u -r625a3e7b5660331938ab739fb28eda3d5540e189 -r3be87f20ac5f89fac33e2db3b95e80c9adfc92d9 --- tests/info-method.test (.../info-method.test) (revision 625a3e7b5660331938ab739fb28eda3d5540e189) +++ tests/info-method.test (.../info-method.test) (revision 3be87f20ac5f89fac33e2db3b95e80c9adfc92d9) @@ -721,7 +721,7 @@ ? {C info configure syntax} "/::C/ ?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" # ? {C info configure syntax a} "/::C/ ?-a /value/?" - ? {C info configure parameters } "-a {-b 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initblock:cmd,optional,noleadingdash" + ? {C info configure parameters } "-a {-b 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" # ? {C info parameter list} "-a -b -volatile -noinit -object-mixin -class -object-filter __initblock" # ? {C info parameter names} "a b volatile noinit object-mixin class object-filter __initblock" Index: tests/info-variable.test =================================================================== diff -u -r2f6bcca3537584c8ef1f9fc71b230e79d1560504 -r3be87f20ac5f89fac33e2db3b95e80c9adfc92d9 --- tests/info-variable.test (.../info-variable.test) (revision 2f6bcca3537584c8ef1f9fc71b230e79d1560504) +++ tests/info-variable.test (.../info-variable.test) (revision 3be87f20ac5f89fac33e2db3b95e80c9adfc92d9) @@ -35,9 +35,9 @@ -name -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg --object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n +-object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class --object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n +-object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" ? {Person info configure parameters age} "-age:integer" Index: tests/parameters.test =================================================================== diff -u -re0419345b49587b5738f87c6d828dfc5ae4b3276 -r3be87f20ac5f89fac33e2db3b95e80c9adfc92d9 --- tests/parameters.test (.../parameters.test) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) +++ tests/parameters.test (.../parameters.test) (revision 3be87f20ac5f89fac33e2db3b95e80c9adfc92d9) @@ -275,7 +275,7 @@ C create c1 ? {C eval :__objectparameter} \ - "{-superclass:class,alias,method=::nsf::methods::class::superclass,1..n ::nx::Object} -mixin:mixinreg,alias,1..n -filter:filterreg,alias,1..n -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initblock:cmd,optional,noleadingdash" + "{-superclass:class,alias,method=::nsf::methods::class::superclass,1..n ::nx::Object} -mixin:mixinreg,alias,0..n -filter:filterreg,alias,0..n -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" #### TOOD: remove or add #? {c1 eval :__objectparameter} \ @@ -307,7 +307,7 @@ "::D::slot::d ::C::slot::a ::C::slot::b ::C::slot::c" ? {d1 eval :__objectparameter} \ - "-d:required -a -b:boolean {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initblock:cmd,optional,noleadingdash" + "-d:required -a -b:boolean {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" } ####################################################### @@ -336,29 +336,29 @@ D mixin M ? {d1 eval :__objectparameter} \ - "-b -m1 -m2 -d:required -a {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initblock:cmd,optional,noleadingdash" \ + "-b -m1 -m2 -d:required -a {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" \ "mixin added" M mixin M2 ? {d1 eval :__objectparameter} \ - "-b2 -b -m1 -m2 -d:required -a {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initblock:cmd,optional,noleadingdash" \ + "-b2 -b -m1 -m2 -d:required -a {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" \ "transitive mixin added" D mixin "" #we should have again the old interface ? {d1 eval :__objectparameter} \ - "-d:required -a -b:boolean {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initblock:cmd,optional,noleadingdash" + "-d:required -a -b:boolean {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" C mixin M ? {d1 eval :__objectparameter} \ - "-b2 -b -m1 -m2 -d:required -a {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initblock:cmd,optional,noleadingdash" \ + "-b2 -b -m1 -m2 -d:required -a {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" \ "mixin added" C mixin "" #we should have again the old interface ? {d1 eval :__objectparameter} \ - "-d:required -a -b:boolean {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initblock:cmd,optional,noleadingdash" + "-d:required -a -b:boolean {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" } ####################################################### @@ -1843,13 +1843,13 @@ nx::Class create M1 {:property b1:required} nx::Class create M2 {:property b2:required} - ? {c1 eval :__objectparameter} "-a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initblock:cmd,optional,noleadingdash" + ? {c1 eval :__objectparameter} "-a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" c1 object mixin M1 ? {c1 info precedence} "::M1 ::C ::nx::Object" - ? {c1 eval :__objectparameter} "-b1:required -a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initblock:cmd,optional,noleadingdash" + ? {c1 eval :__objectparameter} "-b1:required -a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" # # Invalidate the object parameter and expect that the per-class @@ -1952,7 +1952,7 @@ "::C::slot::a1 ::nx::Object::slot::volatile ::nx::Object::slot::__initblock ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::class ::nx::Object::slot::object-filter" ? {c1 eval :__objectparameter} \ - "-a2 -b1:required -a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initblock:cmd,optional,noleadingdash" + "-a2 -b1:required -a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" # # invalidate object parameter and expect that the per-class mixin @@ -1968,7 +1968,7 @@ "::C::slot::a1 ::nx::Object::slot::volatile ::nx::Object::slot::__initblock ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::class ::nx::Object::slot::object-filter" - ? {c1 eval :__objectparameter} "-a2 -b1:required -a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initblock:cmd,optional,noleadingdash" + ? {c1 eval :__objectparameter} "-a2 -b1:required -a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" # should not require b1 ? {C create c2} ::c2