Index: TODO =================================================================== diff -u -r0aeccfecef90977dbe8f105c4e808f7f5313486f -r27030b244334e022169ea7143ce6d91257a8b653 --- TODO (.../TODO) (revision 0aeccfecef90977dbe8f105c4e808f7f5313486f) +++ TODO (.../TODO) (revision 27030b244334e022169ea7143ce6d91257a8b653) @@ -5094,13 +5094,18 @@ nx.tcl: - add slot method value=unset to nx::RelationSlot and nx::VariableSlot - extended regression test +- reworked error message generation of slot-forwarder + (list all available slot methods with prefix value=) +xotcl2: +- use xotcl::RelationSlot instead of nx::Relationslot in xotcl2 + (we can more value=assign here). + Makefile: - fix load paths for sublibs (e.g. mongodb) in regression test ======================================================================== TODO: -- TODO: rework error message generation of slot-forwarder - TODO: demangle "slotassign" in "ObjectParameterSlot protected method getParameterOptions" and check interactions - TODO: clean up relation slot mixin variants Index: library/nx/nx.tcl =================================================================== diff -u -r59f13181ba70df745dca1c5e96ed872703d8662d -r27030b244334e022169ea7143ce6d91257a8b653 --- library/nx/nx.tcl (.../nx.tcl) (revision 59f13181ba70df745dca1c5e96ed872703d8662d) +++ library/nx/nx.tcl (.../nx.tcl) (revision 27030b244334e022169ea7143ce6d91257a8b653) @@ -1333,8 +1333,11 @@ ObjectParameterSlot public method onError {cmd msg} { if {[string match "%1 requires argument*" $msg]} { - #return -code error "wrong # args: use \"$cmd assign|get\" [lsort [:info lookup methods -callprotection public -source application]]" - return -code error "wrong # args: use \"$cmd assign|get\"" + 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 $msg } @@ -1388,7 +1391,7 @@ # Slot objects are always in nx (for nx and for xotcl # application objects. we have to watch for assign and set) # - if {[:info lookup method value=assign] ni {"" "::nsf::classes::nx::RelationSlot::value=assign"}} { + if {[:info lookup method value=assign] ni {"" "::nsf::classes::xotcl::RelationSlot::value=assign"}} { # In case the "assign" method was provided on the slot, ask nsf to call it directly lappend options slot=[::nsf::self] slotassign } elseif {[:info lookup method value=set] ni {"" "::nsf::classes::nx::RelationSlot::value=set"}} { @@ -1528,7 +1531,6 @@ # # create methods for slot operations assign/get/add/delete # - ::nsf::method::alias RelationSlot value=assign ::nsf::relation ::nsf::method::alias RelationSlot value=set ::nsf::relation ::nsf::method::alias RelationSlot value=get ::nsf::relation Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -r5d3bc04b5ec0a4422236a65220d94ceee17a8796 -r27030b244334e022169ea7143ce6d91257a8b653 --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 5d3bc04b5ec0a4422236a65220d94ceee17a8796) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 27030b244334e022169ea7143ce6d91257a8b653) @@ -481,24 +481,28 @@ # We need fully qualified "::xotcl" prefixes, since prefix # completion would skip the object system root namespace + nx::MetaSlot create ::xotcl::RelationSlot -superclass ::nx::RelationSlot + + ::nsf::method::alias ::xotcl::RelationSlot value=assign ::nsf::relation + set cSlotContainer [::nx::slotObj ::xotcl::Class] set oSlotContainer [::nx::slotObj ::xotcl::Object] - ::nx::RelationSlot create ${cSlotContainer}::superclass \ + ::xotcl::RelationSlot create ${cSlotContainer}::superclass \ -defaultmethods {get set} #::nsf::method::alias ${cSlotContainer}::superclass value=set ::nsf::relation - ::nx::RelationSlot create ${oSlotContainer}::class -elementtype class -multiplicity 1..1 \ + ::xotcl::RelationSlot create ${oSlotContainer}::class -elementtype class -multiplicity 1..1 \ -defaultmethods {get set} #::nsf::method::alias ${oSlotContainer}::class value=set ::nsf::relation - ::nx::RelationSlot create ${oSlotContainer}::mixin -forwardername object-mixin \ + ::xotcl::RelationSlot create ${oSlotContainer}::mixin -forwardername object-mixin \ -defaultmethods {get set} \ -elementtype mixinreg -multiplicity 0..n - ::nx::RelationSlot create ${oSlotContainer}::filter -forwardername object-filter \ + ::xotcl::RelationSlot create ${oSlotContainer}::filter -forwardername object-filter \ -defaultmethods {get set} \ -elementtype filterreg -multiplicity 0..n - ::nx::RelationSlot create ${cSlotContainer}::instmixin -forwardername class-mixin \ + ::xotcl::RelationSlot create ${cSlotContainer}::instmixin -forwardername class-mixin \ -defaultmethods {get set} \ -elementtype mixinreg -multiplicity 0..n - ::nx::RelationSlot create ${cSlotContainer}::instfilter -forwardername class-filter \ + ::xotcl::RelationSlot create ${cSlotContainer}::instfilter -forwardername class-filter \ -defaultmethods {get set} \ -elementtype filterreg -multiplicity 0..n Index: tests/methods.test =================================================================== diff -u -rdd169437c7a701da0063a40978614e6148d71221 -r27030b244334e022169ea7143ce6d91257a8b653 --- tests/methods.test (.../methods.test) (revision dd169437c7a701da0063a40978614e6148d71221) +++ tests/methods.test (.../methods.test) (revision 27030b244334e022169ea7143ce6d91257a8b653) @@ -235,8 +235,8 @@ ? {lsort [C object mixin get]} "::M2 ::M4" ? {lsort [C mixin get]} "::M1 ::M3" - ? {lsort [C object mixin]} {wrong # args: use "::C mixin assign|get"} ;# TODO: should be "C object mixin ..." - ? {lsort [C mixin]} {wrong # args: use "::C mixin assign|get"} + ? {lsort [C object mixin]} {wrong # args: use "::C mixin add|delete|get|guard|set|unset"} ;# TODO: should be "C object mixin ..." + ? {lsort [C mixin]} {wrong # args: use "::C mixin add|delete|get|guard|set|unset"} ? {catch {C mixin M5} errorMsg} 1 ? {lsort [C info mixin classes]} "::M1 ::M3" @@ -455,7 +455,7 @@ } # dispatch methods without current object - ? ::o::a {wrong # args: use "::o ::o::a assign|get"} + ? ::o::a {wrong # args: use "::o ::o::a add|delete|get|set|unset"} ? ::o::b "::o2" ? ::o::foo "no current object; command called outside the context of a Next Scripting method" ? ::o::x "no current object; x called outside the context of a Next Scripting method"