Index: TODO =================================================================== diff -u -r164610e4ee54aad4403b5c8940b22ee6ee4ec58a -r620972f9a159f83b824f229ab406331e6bd238de --- TODO (.../TODO) (revision 164610e4ee54aad4403b5c8940b22ee6ee4ec58a) +++ TODO (.../TODO) (revision 620972f9a159f83b824f229ab406331e6bd238de) @@ -2713,13 +2713,13 @@ and "info lookup slots" (similar to "info lookup methods") * extended regression test + * base objectparameter on "info slots" TODO: - missing in c-based "info slots": * handling of pattern (needed?) * handle source (as well in "info lookup slots") * regression tests (eg. "$cls class info slots" vs. "$cls info slots", "-closure") - * base objectparameter on "info slots" - The following is unsafe, but used in nx.tcl (and maybe as well by xotcl2.tcl) obj method foo {{x ""}} { bar ... {*}$x } Index: library/nx/nx.tcl =================================================================== diff -u -r164610e4ee54aad4403b5c8940b22ee6ee4ec58a -r620972f9a159f83b824f229ab406331e6bd238de --- library/nx/nx.tcl (.../nx.tcl) (revision 164610e4ee54aad4403b5c8940b22ee6ee4ec58a) +++ library/nx/nx.tcl (.../nx.tcl) (revision 620972f9a159f83b824f229ab406331e6bd238de) @@ -543,7 +543,6 @@ if {[info exists source]} {lappend cmd -source $source} if {$closure} {lappend cmd -closure} if {[info exists pattern]} {lappend cmd $pattern} - puts stderr XXXXCMD=[list $cmd] ::nsf::my {*}$cmd } :alias "info subclass" ::nsf::methods::class::info::subclass @@ -973,9 +972,9 @@ # Collect the object parameter slots in per-position lists to # ensure partial ordering and avoid sorting. # - #set class [::nsf::relation [self] class] - #foreach slot [nsf::dispatch $class ::nsf::methods::class::info::slots -closure -type ::nx::Slot] {} - foreach slot [nsf::dispatch [self] ::nsf::methods::object::info::lookupslots -type ::nx::Slot] { + set class [::nsf::relation [self] class] + foreach slot [nsf::dispatch $class ::nsf::methods::class::info::slots -closure -type ::nx::Slot] { + #foreach slot [nsf::dispatch [self] ::nsf::methods::object::info::lookupslots -type ::nx::Slot] {} lappend defs([$slot position]) [$slot getParameterSpec] } # Index: tests/parameters.test =================================================================== diff -u -rda6586782390b02ed7660b56417c3db00d63d1c3 -r620972f9a159f83b824f229ab406331e6bd238de --- tests/parameters.test (.../parameters.test) (revision da6586782390b02ed7660b56417c3db00d63d1c3) +++ tests/parameters.test (.../parameters.test) (revision 620972f9a159f83b824f229ab406331e6bd238de) @@ -1566,3 +1566,45 @@ ? {::C::slot::x1 getParameterSpec} {-x1:alias hugo} ? {::C::slot::x2 getParameterSpec} {-x2:alias,substdefault {[self]}} } + +# +# Test potential incfluence on parameters +# +Test case parameter-alias-default { + Class create C { + :attribute a1 + :create c1 { + :attribute a2 + } + } + + Class create M { + :attribute b1:required + } + + c1 mixin M + + ? {c1 info precedence} "::M ::C ::nx::Object" + + ? {C info slots -closure} "::C::slot::a1 ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::filter" + + ? {C eval :objectparameter} "{-superclass:alias,arg=::nsf::methods::class::superclass ::nx::Object} -object-mixin:alias,arg=::nsf::classes::nx::Object::mixin -mixin:alias -object-filter:alias,arg=::nsf::classes::nx::Object::filter -filter:alias -attributes:alias -volatile:alias,noarg -noinit:alias,arg=::nsf::methods::object::noinit,noarg -class:alias,arg=::nsf::methods::object::class __initcmd:initcmd,optional" + + # + # invalidate object parameter and expect that the per-class mixin + # does not harm + # + ::nsf::invalidateobjectparameter C + + c1 configure -a1 x + + ? {c1 info precedence} "::M ::C ::nx::Object" + + ? {C info slots -closure} "::C::slot::a1 ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::filter" + + ? {C eval :objectparameter} "{-superclass:alias,arg=::nsf::methods::class::superclass ::nx::Object} -object-mixin:alias,arg=::nsf::classes::nx::Object::mixin -mixin:alias -object-filter:alias,arg=::nsf::classes::nx::Object::filter -filter:alias -attributes:alias -volatile:alias,noarg -noinit:alias,arg=::nsf::methods::object::noinit,noarg -class:alias,arg=::nsf::methods::object::class __initcmd:initcmd,optional" + + # should not require b1 + ? {C create c2} ::c2 + +} \ No newline at end of file