Index: TODO =================================================================== diff -u -r71eb8c412adf8946fa4930dd00f27898773ae266 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- TODO (.../TODO) (revision 71eb8c412adf8946fa4930dd00f27898773ae266) +++ TODO (.../TODO) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -5020,10 +5020,15 @@ - extend regression test - added more test cases for multiplicity and incremental - preserve lower bound of multiplicity when incemental is added +- added log-level Info which prints always, e.g. for "-verbose" flag + of forwarder ======================================================================== TODO: +- nsf.c: finish forwarder error messages +- finish nx-property reform + - -incremental: setting incremental will promote a property/variable from a non-multivalued one to a multivalued one -> i.e., it becomes 0..* unconditionally Index: generic/nsf.c =================================================================== diff -u -rb13191febb180618e276942c4198873fd7e23ae1 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- generic/nsf.c (.../nsf.c) (revision b13191febb180618e276942c4198873fd7e23ae1) +++ generic/nsf.c (.../nsf.c) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -63,6 +63,8 @@ * provided "as is" without express or implied warranty." */ +#define NSF_FORWARD_WITH_ONERROR 1 + #define NSF_C 1 #include "nsfInt.h" #include "nsfAccessInt.h" @@ -295,11 +297,12 @@ /* prototypes for forwarders */ static void ForwardCmdDeleteProc(ClientData clientData) nonnull(1); static int ForwardProcessOptions(Tcl_Interp *interp, Tcl_Obj *nameObj, - Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withMethodprefix, + Tcl_Obj *withDefault, int withEarlybinding, + Tcl_Obj *withOnerror, Tcl_Obj *withMethodprefix, int withFrame, int withVerbose, Tcl_Obj *target, int objc, Tcl_Obj * CONST objv[], ForwardCmdClientData **tcdPtr) - nonnull(1) nonnull(2) nonnull(10); + nonnull(1) nonnull(2) nonnull(11); /* properties of objects and classes */ static int IsBaseClass(NsfObject *cl) nonnull(1); @@ -511,9 +514,15 @@ assert(fmt); if (RUNTIME_STATE(interp)->debugLevel >= requiredLevel) { - CONST char *level = requiredLevel == NSF_LOG_WARN ? "Warning" : "Notice"; Tcl_DString cmdString, ds; + CONST char *level; + switch (requiredLevel) { + case NSF_LOG_INFO: level = "Info"; break; + case NSF_LOG_NOTICE: level = "Notice"; break; + default: level = "Warning"; break; + } + Tcl_DStringInit(&ds); va_start(ap, fmt); NsfDStringPrintf(&ds, fmt, ap); @@ -15054,8 +15063,11 @@ methodObj = paramPtr->nameObj; result = ForwardProcessOptions(interp, methodObj, - NULL /*withDefault*/, 0 /*withEarlybinding*/, - NULL /*withMethodprefix*/, 0 /*withFrame*/, + NULL /*withDefault*/, + 0 /*withEarlybinding*/, + NULL /*withOnerror*/, + NULL /*withMethodprefix*/, + 0 /*withFrame*/, 0 /*withVerbose*/, nobjv[0], nobjc-1, nobjv+1, &tcd); if (result != TCL_OK) { @@ -16228,9 +16240,13 @@ static int ForwardProcessOptions(Tcl_Interp *interp, Tcl_Obj *nameObj, - Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withMethodprefix, - int withFrame, int withVerbose, - Tcl_Obj *target, int objc, Tcl_Obj * CONST objv[], + Tcl_Obj *withDefault, + int withEarlybinding, + Tcl_Obj *withOnerror, + Tcl_Obj *withMethodprefix, + int withFrame, + int withVerbose, + Tcl_Obj *target, int objc, Tcl_Obj * CONST objv[], ForwardCmdClientData **tcdPtr) { ForwardCmdClientData *tcd; int i, result = 0; @@ -19167,6 +19183,50 @@ *---------------------------------------------------------------------- */ +int +NsfForwardPrintError(Tcl_Interp *interp, ForwardCmdClientData *tcd, + int objc, Tcl_Obj *CONST objv[], + CONST char *fmt, ...) { + Tcl_DString ds; + va_list ap; + int result; + + assert(interp); + assert(tcd); + assert(fmt); + + Tcl_DStringInit(&ds); + + va_start(ap, fmt); + NsfDStringPrintf(&ds, fmt, ap); + va_end(ap); + + if (tcd->onerror) { + Tcl_Obj *script = Tcl_DuplicateObj(tcd->onerror); + Tcl_Obj *cmd; + + if (tcd->object) { + cmd = Tcl_DuplicateObj(tcd->object->cmdName); + } else { + cmd = Tcl_NewObj(); + } + + Tcl_ListObjAppendElement(interp, cmd, Tcl_NewListObj(objc,objv)); + Tcl_ListObjAppendElement(interp, script, cmd); + Tcl_ListObjAppendElement(interp, script, + Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds))); + INCR_REF_COUNT(script); + result = Tcl_EvalObjEx(interp, script, TCL_EVAL_DIRECT); + DECR_REF_COUNT(script); + } else { + result = NsfPrintError(interp, "%s", Tcl_DStringValue(&ds)); + } + + Tcl_DStringFree(&ds); + return result; +} + + static int ForwardArg(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *ForwardArgObj, ForwardCmdClientData *tcd, Tcl_Obj **out, Tcl_Obj **freeList, int *inputArg, int *mapvalue, @@ -19204,6 +19264,7 @@ if (c == '%' && *(ForwardArgString+1) == '@') { char *remainder = NULL; long pos; + ForwardArgString += 2; pos = strtol(ForwardArgString, &remainder, 0); /*fprintf(stderr, "strtol('%s) returned %ld '%s'\n", ForwardArgString, pos, remainder);*/ @@ -19284,7 +19345,9 @@ ObjStr(listElements[nrPosArgs]));*/ *out = listElements[nrPosArgs]; } else if (objc <= 1) { - return NsfObjWrongArgs(interp, "%1 requires argument;", objv[0], NULL, "arg ..."); + + return NsfForwardPrintError(interp, tcd, objc, objv, + "%%1 requires argument; should be \"%s arg ...\"", ObjStr(objv[0])); } else { /*fprintf(stderr, "copying %%1: '%s'\n", ObjStr(objv[firstPosArg]));*/ *out = objv[firstPosArg]; @@ -19440,7 +19503,7 @@ if (unlikely(tcd->verbose)) { Tcl_Obj *cmd = Tcl_NewListObj(objc, objv); - NsfLog(interp, NSF_LOG_NOTICE, "forwarder calls '%s'", ObjStr(cmd)); + NsfLog(interp, NSF_LOG_INFO, "forwarder calls '%s'", ObjStr(cmd)); DECR_REF_COUNT(cmd); } if (tcd->frame == FrameObjectIdx) { @@ -19468,13 +19531,8 @@ #if defined(NSF_FORWARD_WITH_ONERROR) if (unlikely(result == TCL_ERROR && tcd->onerror)) { - Tcl_Obj *ov[2]; - ov[0] = tcd->onerror; - ov[1] = Tcl_GetObjResult(interp); - INCR_REF_COUNT(ov[1]); - /*Tcl_EvalObjEx(interp, tcd->onerror, TCL_EVAL_DIRECT);*/ - Tcl_EvalObjv(interp, 2, ov, 0); - DECR_REF_COUNT(ov[1]); + result = NsfForwardPrintError(interp, tcd, objc, objv, "%s", + ObjStr(Tcl_GetObjResult(interp))); } #endif @@ -23950,11 +24008,14 @@ */ static int NsfMethodForwardCmd(Tcl_Interp *interp, - NsfObject *object, int withPer_object, - Tcl_Obj *methodObj, - Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withMethodprefix, - int withFrame, int withVerbose, - Tcl_Obj *target, int nobjc, Tcl_Obj *CONST nobjv[]) { + NsfObject *object, int withPer_object, + Tcl_Obj *methodObj, + Tcl_Obj *withDefault, + int withEarlybinding, + Tcl_Obj *withOnerror, + Tcl_Obj *withMethodprefix, + int withFrame, int withVerbose, + Tcl_Obj *target, int nobjc, Tcl_Obj *CONST nobjv[]) { ForwardCmdClientData *tcd = NULL; int result; @@ -23963,7 +24024,8 @@ assert(methodObj); result = ForwardProcessOptions(interp, methodObj, - withDefault, withEarlybinding, withMethodprefix, + withDefault, withEarlybinding, + withOnerror, withMethodprefix, withFrame, withVerbose, target, nobjc, nobjv, &tcd); Index: generic/nsf.h =================================================================== diff -u -rb13191febb180618e276942c4198873fd7e23ae1 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- generic/nsf.h (.../nsf.h) (revision b13191febb180618e276942c4198873fd7e23ae1) +++ generic/nsf.h (.../nsf.h) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -407,6 +407,7 @@ */ #define NSF_LOG_NOTICE 2 #define NSF_LOG_WARN 1 +#define NSF_LOG_INFO 0 EXTERN void NsfLog(Tcl_Interp *interp, int requiredLevel, CONST char *fmt, ...) Index: generic/nsfAPI.decls =================================================================== diff -u -rcaba76f5ac2943f5a3dfd33550cb578132f40c80 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- generic/nsfAPI.decls (.../nsfAPI.decls) (revision caba76f5ac2943f5a3dfd33550cb578132f40c80) +++ generic/nsfAPI.decls (.../nsfAPI.decls) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -146,6 +146,7 @@ {-argName "method" -required 1 -type tclobj} {-argName "-default" -type tclobj} {-argName "-earlybinding" -nrargs 0} + {-argName "-onerror" -type tclobj} {-argName "-prefix" -type tclobj} {-argName "-frame" -nrargs 1 -type "object|method|default" -default default} {-argName "-verbose" -nrargs 0} Index: generic/nsfAPI.h =================================================================== diff -u -r872d1371a257c8a20383ae70efa83bbf3ff78f96 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- generic/nsfAPI.h (.../nsfAPI.h) (revision 872d1371a257c8a20383ae70efa83bbf3ff78f96) +++ generic/nsfAPI.h (.../nsfAPI.h) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -578,7 +578,7 @@ NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(7) NSF_nonnull(8) NSF_nonnull(9); static int NsfMethodDeleteCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *methodName) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); -static int NsfMethodForwardCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *method, Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withPrefix, int withFrame, int withVerbose, Tcl_Obj *target, int nobjc, Tcl_Obj *CONST nobjv[]) +static int NsfMethodForwardCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *method, Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withOnerror, Tcl_Obj *withPrefix, int withFrame, int withVerbose, Tcl_Obj *target, int nobjc, Tcl_Obj *CONST nobjv[]) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); static int NsfMethodPropertyCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *methodName, int methodProperty, Tcl_Obj *value) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); @@ -1726,13 +1726,14 @@ Tcl_Obj *method = (Tcl_Obj *)pc.clientData[2]; Tcl_Obj *withDefault = (Tcl_Obj *)pc.clientData[3]; int withEarlybinding = (int )PTR2INT(pc.clientData[4]); - Tcl_Obj *withPrefix = (Tcl_Obj *)pc.clientData[5]; - int withFrame = (int )PTR2INT(pc.clientData[6]); - int withVerbose = (int )PTR2INT(pc.clientData[7]); - Tcl_Obj *target = (Tcl_Obj *)pc.clientData[8]; + Tcl_Obj *withOnerror = (Tcl_Obj *)pc.clientData[5]; + Tcl_Obj *withPrefix = (Tcl_Obj *)pc.clientData[6]; + int withFrame = (int )PTR2INT(pc.clientData[7]); + int withVerbose = (int )PTR2INT(pc.clientData[8]); + Tcl_Obj *target = (Tcl_Obj *)pc.clientData[9]; assert(pc.status == 0); - return NsfMethodForwardCmd(interp, object, withPer_object, method, withDefault, withEarlybinding, withPrefix, withFrame, withVerbose, target, objc-pc.lastObjc, objv+pc.lastObjc); + return NsfMethodForwardCmd(interp, object, withPer_object, method, withDefault, withEarlybinding, withOnerror, withPrefix, withFrame, withVerbose, target, objc-pc.lastObjc, objv+pc.lastObjc); } else { return TCL_ERROR; @@ -3238,12 +3239,13 @@ {"-per-object", 0, 0, Nsf_ConvertTo_Boolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"methodName", NSF_ARG_REQUIRED, 1, Nsf_ConvertTo_Tclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::method::forward", NsfMethodForwardCmdStub, 10, { +{"::nsf::method::forward", NsfMethodForwardCmdStub, 11, { {"object", NSF_ARG_REQUIRED, 1, Nsf_ConvertTo_Object, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, {"-per-object", 0, 0, Nsf_ConvertTo_Boolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"method", NSF_ARG_REQUIRED, 1, Nsf_ConvertTo_Tclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-default", 0, 1, Nsf_ConvertTo_Tclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-earlybinding", 0, 0, Nsf_ConvertTo_String, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-onerror", 0, 1, Nsf_ConvertTo_Tclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-prefix", 0, 1, Nsf_ConvertTo_Tclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-frame", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToFrame, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-verbose", 0, 0, Nsf_ConvertTo_String, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, Index: library/lib/nx-test.tcl =================================================================== diff -u -r4bc60e16c10fdbbb640b3019d4bdebdc469fdf55 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- library/lib/nx-test.tcl (.../nx-test.tcl) (revision 4bc60e16c10fdbbb640b3019d4bdebdc469fdf55) +++ library/lib/nx-test.tcl (.../nx-test.tcl) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -23,7 +23,7 @@ :property cmd :property {namespace ::} :property {verbose:boolean 0} - :property -accessor public {expected 1} + :property {expected 1} :property {count:integer 1} :property msg :property setResult @@ -198,7 +198,7 @@ } else { set t [nx::test new -cmd $cmd -namespace $namespace] } - $t expected $expected + $t configure -expected $expected $t run nsf::__db_run_assertions } Index: library/nx/nx.tcl =================================================================== diff -u -rb54474b067ec70729c067df9c719ef7f4dc95462 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- library/nx/nx.tcl (.../nx.tcl) (revision b54474b067ec70729c067df9c719ef7f4dc95462) +++ library/nx/nx.tcl (.../nx.tcl) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -1308,6 +1308,18 @@ ::nsf::next } + # + # good old default: TODO question in case of nx-relation slot + # + ObjectParameterSlot protected method createForwarder {name domain} { + ::nsf::method::forward $domain \ + -per-object=${:per-object} \ + $name \ + ${:manager} \ + [list %1 [${:manager} defaultmethods]] %self \ + ${:forwardername} + } + ObjectParameterSlot protected method makeForwarder {} { # # Build forwarder from the source object class ($domain) to the slot @@ -1323,19 +1335,10 @@ set d [nsf::directdispatch ${:domain} \ ::nsf::classes::nx::Object::__resolve_method_path \ {*}[expr {${:per-object} ? "-per-object" : ""}] ${:settername}] - set name [dict get $d methodName] - set domain [dict get $d object] + :createForwarder [dict get $d methodName] [dict get $d object] } else { - set name ${:name} - set domain ${:domain} + :createForwarder ${:name} ${:domain} } - - ::nsf::method::forward $domain \ - {*}[expr {${:per-object} ? "-per-object" : ""}] \ - $name \ - ${:manager} \ - [list %1 [${:manager} defaultmethods]] %self \ - ${:forwardername} } ObjectParameterSlot protected method getParameterOptions { @@ -1792,6 +1795,30 @@ return 1 } + if {1} { + # + # TODO: remove if + # + ::nx::VariableSlot protected method needsForwarder {} { + return 1 + } + ::nx::VariableSlot protected method createForwarder {name domain} { + ::nsf::method::forward $domain \ + -per-object=${:per-object} \ + $name \ + -onerror [list ${:manager} onError] \ + ${:manager} \ + %1 %self \ + ${:forwardername} + } + ::nx::VariableSlot public method onError {cmd msg} { + if {[string match "%1 requires argument*" $msg]} { + return -code error "wrong # args: use \"$cmd assign|get\"" + } + return -code error $msg + } + } + ::nx::VariableSlot public method makeAccessor {} { if {${:accessor} eq "none"} { Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -rcaba76f5ac2943f5a3dfd33550cb578132f40c80 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision caba76f5ac2943f5a3dfd33550cb578132f40c80) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -426,8 +426,15 @@ ::xotcl::Class instproc parameter {arglist} { set slotContainer [::nx::slotObj [::nsf::self]] foreach arg $arglist { - #puts stderr "[self] ::nsf::classes::nx::Class::property $arg" - [self] ::nsf::classes::nx::Class::property -accessor public $arg + puts stderr "[self] ::nsf::classes::nx::Class::property -accessor public $arg" + #[self] ::nsf::classes::nx::Class::property -accessor public $arg + if {[llength $arg] > 1} { + ::nx::MetaSlot createFromParameterSpec [::nsf::self] [lindex $arg 0] [lindex $arg 1] + } else { + ::nx::MetaSlot createFromParameterSpec [::nsf::self] $arg + } + #[self] ::nsf::classes::nx::Class::property -accessor public $arg + ::nsf::method:::setter [self] [lindex $arg 0] } ::nsf::var::set $slotContainer __parameter $arglist } @@ -1003,6 +1010,7 @@ # Create ::xotcl::Attribute for compatibility # ::xotcl::MetaSlot create ::xotcl::Attribute -superclass ::nx::VariableSlot { + :property -accessor public multivalued { :public object method assign {object property value} { set mClass [expr {$value ? "0..n" : "1..1"}] @@ -1014,6 +1022,31 @@ } } + :protected method needsForwarder {} { + # + # We just forward, when + # * "assign" and "add" are still untouched, or + # * or incremental is specified + # + if {[:info lookup method assign] ne "::nsf::classes::nx::VariableSlot::assign"} {return 1} + if {[:info lookup method add] ne "::nsf::classes::nx::VariableSlot::add"} {return 1} + if {[:info lookup method get] ne "::nsf::classes::nx::VariableSlot::get"} {return 1} + if {[info exists :settername]} {return 1} + if {!${:incremental}} {return 0} + #if {![:isMultivalued]} {return 0} + #puts stderr "[self] ismultivalued" + return 1 + } + + :public method createForwarder {name domain} { + ::nsf::method::forward $domain \ + -per-object=${:per-object} \ + $name \ + ${:manager} \ + [list %1 [${:manager} defaultmethods]] %self \ + ${:forwardername} + } + :public method __objectparameter {} { set slotObjects [nsf::directdispatch [self] ::nsf::methods::object::info::lookupslots -type ::nx::Slot] set parameterDefinitions [::nsf::parameter::specs -nonposargs $slotObjects] Index: tests/cget.test =================================================================== diff -u -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- tests/cget.test (.../cget.test) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) +++ tests/cget.test (.../cget.test) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -206,7 +206,7 @@ # - cget # - dispatch of cget method with full path # - cget via slot method - ? {p1 age} 25 + ? {p1 age get} 25 ? {p1 cget -age} 25 ? {p1 ::nsf::methods::object::cget -age} 25 ? {p1 cget -bar} 101 @@ -216,7 +216,7 @@ # - built-in accessor # - configure # - configure via slot method - ? {p1 age 27} 27 + ? {p1 age assign 27} 27 ? {p1 configure -age 27} "" ? {p1 configure -bar 102} "" Index: tests/destroy.test =================================================================== diff -u -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- tests/destroy.test (.../destroy.test) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) +++ tests/destroy.test (.../destroy.test) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -31,7 +31,9 @@ :destroy puts stderr "AAAA [current] exists [::nsf::object::exists [current]]" :set x 1 + puts stderr XXXX2 ? "[current] set x" 1 "$::case can still access [current]" + puts stderr XXXX3 ? {::nsf::object::exists c1} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" Index: tests/disposition.test =================================================================== diff -u -rcd33e8cefca1d52063ebcb6689e46527bb94e33d -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- tests/disposition.test (.../disposition.test) (revision cd33e8cefca1d52063ebcb6689e46527bb94e33d) +++ tests/disposition.test (.../disposition.test) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -1358,15 +1358,15 @@ ::xotcl::Class create XC -parameter {a b c} ::XC instproc init args {set :x $args; incr :y} + ? {XC create xc1 -a 1} ::xc1 + ? {XC create xc2 x y -a 1} ::xc2 + ::nx::Class create C { :property a :property b :property c :method init args {set :x $args; incr :y} } - - ? {XC create xc1 -a 1} ::xc1 - ? {XC create xc2 x y -a 1} ::xc2 ? {C create c1 -a 1} ::c1 ? {xc2 eval {info exists :a}} 1 Index: tests/info-method.test =================================================================== diff -u -r8776580a91fa04fd52378dd37143f6c27769c8ab -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- tests/info-method.test (.../info-method.test) (revision 8776580a91fa04fd52378dd37143f6c27769c8ab) +++ tests/info-method.test (.../info-method.test) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -119,8 +119,8 @@ ? {C info object method definition add1} "::C public object forward add1 expr 1 +" ? {C info object method definition fpo} "::C public object forward fpo ::o" - ? {C info method definition s} "::C public setter s" - ? {C info object method definition spo} "::C public object setter spo" + ? {C info method definition s} "::C public forward s ::C::slot::s %1 %self s" + ? {C info object method definition spo} "::C public object forward spo ::C::per-object-slot::spo %1 %self spo" ? {C info method definition a} "::C public alias a ::set" ? {C info object method definition apo} "::C public object alias apo ::puts" Index: tests/info-variable.test =================================================================== diff -u -rd41e002df986bd8be7048c3344880e29eb30bec5 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- tests/info-variable.test (.../info-variable.test) (revision d41e002df986bd8be7048c3344880e29eb30bec5) +++ tests/info-variable.test (.../info-variable.test) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -65,7 +65,7 @@ :property -accessor private {p 19} :property -accessor protected q :property -incremental i - :public method m {} {: -local p} + :public method m {} {: -local p get} :create f1 } Index: tests/methods.test =================================================================== diff -u -r714fdeeeeca44ee6f77d93349a0afec4c4b139cc -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- tests/methods.test (.../methods.test) (revision 714fdeeeeca44ee6f77d93349a0afec4c4b139cc) +++ tests/methods.test (.../methods.test) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -66,10 +66,10 @@ } C property -accessor public s0 C property -accessor protected s1 -? {c1 s0 0} 0 -? {::nsf::dispatch c1 s1 1} 1 +? {c1 s0 assign 0} 0 +? {::nsf::dispatch c1 s1 assign 1} 1 C object property -accessor public {s3 ""} -? {C s3 3} 3 +? {C s3 assign 3} 3 # create a fresh object (different from c1) C create c2 @@ -93,9 +93,9 @@ nx::test case class-level-setter { ? {c2 plain_setter 1} {::c2: unable to dispatch method 'plain_setter'} #? {c2 plain_setter 1} 1 - ? {c2 public_setter 2} "2" - ? {catch {c2 protected_setter 3}} 1 - ? {::nsf::dispatch c2 protected_setter 4} "4" + ? {c2 public_setter assign 2} "2" + ? {catch {c2 protected_setter assign 3}} 1 + ? {::nsf::dispatch c2 protected_setter assign 4} "4" } # class level alias .... @@ -128,9 +128,9 @@ nx::test case class-object-level-setter { ? {C plain_object_setter 1} {method 'plain_object_setter' unknown for ::C; consider '::C create plain_object_setter 1' instead of '::C plain_object_setter 1'} #? {C plain_object_setter 1} "1" - ? {C public_object_setter 2} "2" - ? {catch {C protected_object_setter 3}} 1 - ? {::nsf::dispatch C protected_object_setter 4} "4" + ? {C public_object_setter assign 2} "2" + ? {catch {C protected_object_setter assign 3}} 1 + ? {::nsf::dispatch C protected_object_setter assign 4} "4" } # class level alias .... @@ -163,9 +163,9 @@ nx::test case object-level-setter { ? {c1 plain_object_setter 1} {::c1: unable to dispatch method 'plain_object_setter'} #? {c1 plain_object_setter 1} "1" - ? {c1 public_object_setter 2} "2" - ? {catch {c1 protected_object_setter 3}} 1 - ? {::nsf::dispatch c1 protected_object_setter 4} "4" + ? {c1 public_object_setter assign 2} "2" + ? {catch {c1 protected_object_setter assign 3}} 1 + ? {::nsf::dispatch c1 protected_object_setter assign 4} "4" } # object level alias .... @@ -282,16 +282,16 @@ } C create c1 -a 1 - ? {c1 a} 1 + ? {c1 a get} 1 ? {c1 cget -b} b1 ? {c1 cget -c} c1 ? {c1 d} "::c1: unable to dispatch method 'd'" - ? {C A 2} 2 - ? {C A} 2 + ? {C A assign 2} 2 + ? {C A get} 2 ? {C B} {method 'B' unknown for ::C; consider '::C create B ' instead of '::C B '} #? {C B} B2 - ? {C C} C2 + ? {C C get} C2 ? {C D} "method 'D' unknown for ::C; consider '::C create D ' instead of '::C D '" nx::Object create o { @@ -303,10 +303,10 @@ :object property -accessor public {c c1} :object property -accessor protected {d d1} } - ? {o a 2} 2 + ? {o a assign 2} 2 ? {o b} {::o: unable to dispatch method 'b'} #? {o b} b1 - ? {o c} c1 + ? {o c get} c1 ? {o d} "::o: unable to dispatch method 'd'" } @@ -347,11 +347,11 @@ :property -accessor public a:int :create c1 } - ? {C x 1} 1 - ? {C x} 1 + ? {C x assign 1} 1 + ? {C x get} 1 ? {lsort [C info methods]} "a" ? {lsort [C info object methods]} "x" - ? {c1 a b} {expected integer but got "b" for parameter "a"} + ? {c1 a assign b} {expected integer but got "b" for parameter "value"} set s(C) [C serialize] set s(c1) [c1 serialize] @@ -370,10 +370,10 @@ ? {nsf::object::exists c1} 1 # tests should work as again - ? {C x} 1 + ? {C x get} 1 ? {lsort [C info methods]} "a" ? {lsort [C info object methods]} "x" - ? {c1 a b} {expected integer but got "b" for parameter "a"} + ? {c1 a assign b} {expected integer but got "b" for parameter "value"} } # @@ -434,7 +434,7 @@ } # dispatch methods without current object - ? ::o::a "method ::o::a not dispatched on valid object" + ? ::o::a {wrong # args: use "::o ::o::a assign|get"} ? ::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" Index: tests/parameters.test =================================================================== diff -u -rd41e002df986bd8be7048c3344880e29eb30bec5 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- tests/parameters.test (.../parameters.test) (revision d41e002df986bd8be7048c3344880e29eb30bec5) +++ tests/parameters.test (.../parameters.test) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -527,23 +527,23 @@ ? {d1 bar -c 1} {::d1-[current]-1-2} "substdefault in method parameter" nx::Class create Bar -superclass D { - :property -accessor public {s "[current]"} - :property -accessor public {literal "\\[current\\]"} - :property -accessor public {c "[:info class]"} - :property -accessor public {d "literal $d"} + :property {s "[current]"} + :property {literal "\\[current\\]"} + :property {c "[:info class]"} + :property {d "literal $d"} } ? {Bar property -accessor public ss:switch} "::nsf::classes::Bar::ss" Bar create bar1 #puts stderr [bar1 __objectparameter] - ? {subst {[bar1 s]-[bar1 literal]-[bar1 c]-[bar1 d]}} \ + ? {subst {[bar1 cget -s]-[bar1 cget -literal]-[bar1 cget -c]-[bar1 cget -d]}} \ {::bar1-[current]-::Bar-literal $d} \ "substdefault in object parameter 1" Bar create bar2 - ? {subst {[bar2 s]-[bar2 literal]-[bar2 c]-[bar2 d]}} \ + ? {subst {[bar2 cget -s]-[bar2 cget -literal]-[bar2 cget -c]-[bar2 cget -d]}} \ {::bar2-[current]-::Bar-literal $d} \ "substdefault in object parameter 2" @@ -620,7 +620,7 @@ "query instparams for scripted method 'method'" ? {nx::Object info method parameters ::nsf::method::forward} \ - "object:object -per-object:switch method -default -earlybinding:switch -prefix -frame -verbose:switch target:optional args" \ + "object:object -per-object:switch method -default -earlybinding:switch -onerror -prefix -frame -verbose:switch target:optional args" \ "query parameter for C-defined cmd 'nsf::forward'" nx::Object require method autoname @@ -1060,18 +1060,18 @@ } } - ? {ParamTest info method definition os} "::ParamTest public setter os:object,1..n" + ? {ParamTest info method definition os} "::ParamTest public forward os ::ParamTest::slot::os %1 %self os" - ? {p os o} \ + ? {p os assign o} \ "o" \ "value is a list of objects (1 element)" - ? {p os {o c1 d1}} \ + ? {p os assign {o c1 d1}} \ "o c1 d1" \ "value is a list of objects (multiple elements)" - ? {p os {o xxx d1}} \ - {invalid value in "o xxx d1": expected object but got "xxx" for parameter "os"} \ + ? {p os assign {o xxx d1}} \ + {invalid value in "o xxx d1": expected object but got "xxx" for parameter "value"} \ "list with invalid object" } @@ -1183,10 +1183,10 @@ Person create p1 -sex male ? {p1 cget -sex} m - ? {p1 sex} m + ? {p1 sex get} m Person public method foo {s:sex,slot=::Person::slot::sex,convert} {return $s} ? {p1 foo male} m - ? {p1 sex male} m + ? {p1 sex assign male} m } ####################################################### @@ -1244,9 +1244,9 @@ } C create c1 - ? {c1 a 1} 1 - ? {c1 b 1} 1 - ? {c1 c 1} 1 + ? {c1 a assign 1} 1 + ? {c1 b assign 1} 1 + ? {c1 c assign 1} 1 } nx::test configure -count 10 @@ -1259,7 +1259,7 @@ ? {C create c1 -a 1 -b 2} ::c1 ? {c1 info vars} "a b c" - ? {c1 a 100} 100 + ? {c1 a assign 100} 100 ? {c1 b 101} {::c1: unable to dispatch method 'b'} ? {c1 c 102} {::c1: unable to dispatch method 'c'} } @@ -1315,16 +1315,16 @@ :object property -accessor public c {set :valuechangedcmd { ::nsf::var::set $obj $var 999 }} } - ? {o a} 4 - ? {o b} 44 - ? {o c 5} 999 + ? {o a get} 4 + ? {o b get} 44 + ? {o c assign 5} 999 ? {::nsf::object::property o hasperobjectslots} 1 o copy o2 - ? {o a} 4 - ? {o b} 44 - ? {o c 5} 999 + ? {o a get} 4 + ? {o b get} 44 + ? {o c assign 5} 999 ? {::nsf::object::property o2 hasperobjectslots} 1 ::nx::Class create C { @@ -1333,22 +1333,22 @@ :property -accessor public c {set :valuechangedcmd { ::nsf::var::set $obj $var 999 }} :create c1 } - ? {c1 a} 4 - ? {c1 b} 44 - ? {c1 c 5} 999 + ? {c1 a get} 4 + ? {c1 b get} 44 + ? {c1 c assign 5} 999 c1 copy c2 - ? {c2 a} 4 - ? {c2 b} 44 - ? {c2 c 5} 999 + ? {c2 a get} 4 + ? {c2 b get} 44 + ? {c2 c assign 5} 999 C copy D D create d1 - ? {d1 a} 4 - ? {d1 b} 44 - ? {d1 c 5} 999 + ? {d1 a get} 4 + ? {d1 b get} 44 + ? {d1 c assign 5} 999 } nx::test case slot-trace-interaction { @@ -1392,10 +1392,10 @@ } ? {o eval {info exists :a}} 1 - ? {o a} 0 - ? {o a 1} 2 - ? {o a} 2 - ? {o a 2} 3 + ? {o a get} 0 + ? {o a assign 1} 2 + ? {o a get} 2 + ? {o a assign 2} 3 ? {o eval {info exists :A}} 0 o object property {A 0} { @@ -1428,10 +1428,10 @@ Klass create k ? {k eval {info exists :a}} 1 - ? {k a} 0; # should be 1, reflecting the corresponding per-object case above - ? {k a 1} 2 - ? {k a} 2 - ? {k a 2} 3 + ? {k a get} 0; # should be 1, reflecting the corresponding per-object case above + ? {k a assign 1} 2 + ? {k a get} 2 + ? {k a assign 2} 3 # # 2) Have initcmd scripts escaped from C-level argument checking (in @@ -1480,7 +1480,7 @@ ? {cc cget -a} 4 ? {cc cget -b} 44 - ? {cc c 5} 999 + ? {cc c assign 5} 999 } @@ -1620,15 +1620,15 @@ :property -accessor public {a 1} :create c1 } - ? {c1 a} 1 + ? {c1 cget -a} 1 # change the value from the default to a different value - ? {c1 a 2} 2 - ? {c1 a} 2 + ? {c1 a assign 2} 2 + ? {c1 a get} 2 # call configure ... c1 __configure # ... and check, it did not reset the value to the default - ? {c1 a} 2 + ? {c1 a get} 2 } nx::test case setter-under-coloncmd-and-interpvarresolver { @@ -2444,16 +2444,16 @@ # uses the parameter type "boolean" instead. ? {C info methods} "foo" ? {c1 info lookup method foo} "::nsf::classes::C::foo" - ? {c1 foo} 0 - ? {c1 foo 1} 1 - ? {c1 foo} 1 + ? {c1 foo get} 0 + ? {c1 foo assign 1} 1 + ? {c1 foo get} 1 # When the object parameter is specified, the instance variable has # a value of true (i.e. 1) C create c2 -foo ? {lsort [c2 info vars]} {foo} ? {c2 eval {set :foo}} {1} - ? {c1 foo} 1 + ? {c1 foo get} 1 # One can pass false (and other values) with the = notation as well C create c3 -foo=false @@ -2667,14 +2667,14 @@ set o [Foo new] ? [list $o eval {info exists :bar}] 0 ? {set ::slotcalls} 0 - ? [list $o bar] {can't read "bar": no such variable} + ? [list $o bar get] {can't read "bar": no such variable} # call without default, with object parameter value set o [Foo new -bar "test"] ? [list $o eval {info exists :bar}] 1 ? {set ::slotcalls} 1 - ? [list $o bar] "test" + ? [list $o bar get] "test" # test cases for default set ::slotcalls 0 @@ -2691,14 +2691,14 @@ set o [Foo new] ? [list $o eval {info exists :baz}] 1 ? {set ::slotcalls} 1 - ? [list $o baz] "1" + ? [list $o baz get] "1" # call with default, with object parameter value set o [Foo new -baz "test"] ? [list $o eval {info exists :baz}] 1 ? {set ::slotcalls} 2 - ? [list $o baz] "test" + ? [list $o baz get] "test" ? {Foo info method exists baz} 1 } @@ -2784,8 +2784,8 @@ } ? {Test2 create t2} ::t2 - ? {t2 list 3} {::t2 list 3} - ? {t2 list} {::t2 list 3} + ? {t2 list assign 3} {::t2 list 3} + ? {t2 list get} {::t2 list 3} ? {t2 list this should call unknown} "unknown" } @@ -2810,7 +2810,7 @@ } a 1}} 0 ? {o eval {info exists :a}} 1 ? {o eval {info exists :assignCalled}} 0; # !!! should be 1 - ? {o a} 1 + ? {o a get} 1 } nx::test case cmd-error-propagation { Index: tests/properties.test =================================================================== diff -u -r71eb8c412adf8946fa4930dd00f27898773ae266 -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- tests/properties.test (.../properties.test) (revision 71eb8c412adf8946fa4930dd00f27898773ae266) +++ tests/properties.test (.../properties.test) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -33,7 +33,7 @@ # a non-configurable property is a variable :property -accessor none -configurable false {vf vf1} - :public method call-local {v} {: -local $v} + :public method call-local {v} {: -local $v get} :create c1 } @@ -126,24 +126,24 @@ # ? {c1 a} {::c1: unable to dispatch method 'a'} - ? {c1 b} b1 + ? {c1 b get} b1 ? {c1 c} {::c1: unable to dispatch method 'c'} ? {c1 d} {::c1: unable to dispatch method 'd'} ? {c1 eval ":a"} {::c1: unable to dispatch method 'a'} - ? {c1 eval ":b"} b1 - ? {c1 eval ":c"} c1 + ? {c1 eval ":b get"} b1 + ? {c1 eval ":c get"} c1 ? {c1 eval ":d"} {::c1: unable to dispatch method 'd'} ? {c1 va} {::c1: unable to dispatch method 'va'} - ? {c1 vb} vb1 + ? {c1 vb get} vb1 ? {c1 vc} {::c1: unable to dispatch method 'vc'} ? {c1 vd} {::c1: unable to dispatch method 'vd'} ? {c1 eval ":va"} {::c1: unable to dispatch method 'va'} - ? {c1 eval ":vb"} vb1 - ? {c1 eval ":vc"} vc1 + ? {c1 eval ":vb get"} vb1 + ? {c1 eval ":vc get"} vc1 ? {c1 eval ":vd"} {::c1: unable to dispatch method 'vd'} # @@ -160,9 +160,9 @@ # cases) # - ? {c1 b add x} {wrong # args should be "::c1 b ?value?"} + ? {c1 b add x} {property b of ::C ist not multivalued} ? {c1 c add x} {::c1: unable to dispatch method 'c'} - ? {c1 eval {:c add x}} {wrong # args should be "::c1 c ?value?"} + ? {c1 eval {:c add x}} {property c of ::C ist not multivalued} ? {c1 d add x} {::c1: unable to dispatch method 'd'} ? {c1 eval {:d add x}} {::c1: unable to dispatch method 'd'} ? {c1 e add x} {::c1: unable to dispatch method 'e'} @@ -173,9 +173,9 @@ # ? {c1 va add x} {::c1: unable to dispatch method 'va'} - ? {c1 vb add x} {wrong # args should be "::c1 vb ?value?"} + ? {c1 vb add x} {property vb of ::C ist not multivalued} ? {c1 vc add x} {::c1: unable to dispatch method 'vc'} - ? {c1 eval {:vc add x}} {wrong # args should be "::c1 vc ?value?"} + ? {c1 eval {:vc add x}} {property vc of ::C ist not multivalued} ? {c1 vd add x} {::c1: unable to dispatch method 'vd'} ? {c1 eval {:vd add x}} {::c1: unable to dispatch method 'vd'} ? {c1 ve add x} {::c1: unable to dispatch method 've'} @@ -185,7 +185,7 @@ # The accessor should be a setter due to incremental # - ? {C info method definition b} {::C public setter b} + ? {C info method definition b} {::C public forward b ::C::slot::b %1 %self b} # # check error message on a typo. The following command does a @@ -221,7 +221,7 @@ :variable -accessor private -incremental vd vd1 :variable -accessor none -incremental ve ve1 - :public method call-local {v} {: -local $v} + :public method call-local {v} {: -local $v get} :public method add-local {var value} {: -local $var add $value} :create c1 @@ -294,26 +294,26 @@ # can we call the accessor directly or via "eval" # - ? {c1 a} a1 - ? {c1 b} b1 + ? {c1 a get} a1 + ? {c1 b get} b1 ? {c1 c} {::c1: unable to dispatch method 'c'} ? {c1 d} {::c1: unable to dispatch method 'd'} - ? {c1 eval ":a"} a1 - ? {c1 eval ":b"} b1 - ? {c1 eval ":c"} c1 + ? {c1 eval ":a get"} a1 + ? {c1 eval ":b get"} b1 + ? {c1 eval ":c get"} c1 ? {c1 eval ":d"} {::c1: unable to dispatch method 'd'} - ? {c1 va} va1 - ? {c1 vb} vb1 + ? {c1 va get} va1 + ? {c1 vb get} vb1 ? {c1 vc} {::c1: unable to dispatch method 'vc'} ? {c1 vd} {::c1: unable to dispatch method 'vd'} - ? {c1 eval ":va"} va1 - ? {c1 eval ":vb"} vb1 - ? {c1 eval ":vc"} vc1 - ? {c1 eval ":vd"} {::c1: unable to dispatch method 'vd'} + ? {c1 eval ":va get"} va1 + ? {c1 eval ":vb get"} vb1 + ? {c1 eval ":vc get"} vc1 + ? {c1 eval ":vd get"} {::c1: unable to dispatch method 'vd'} # # check the behavior of "private" properties and variables @@ -356,7 +356,7 @@ # The accessor should be a forwarder due to incremental # - ? {CC info method definition b} {::CC public forward b ::CC::slot::b {%1 {get assign}} %self b} + ? {CC info method definition b} {::CC public forward b ::CC::slot::b %1 %self b} # # check error message @@ -392,7 +392,7 @@ :object variable -accessor private vd vd1 :object variable -accessor none ve ve1 - :public object method call-local {v} {: -local $v} + :public object method call-local {v} {: -local $v get} } @@ -474,23 +474,23 @@ # ? {o1 a} {::o1: unable to dispatch method 'a'} - ? {o1 b} b1 + ? {o1 b get} b1 ? {o1 c} {::o1: unable to dispatch method 'c'} ? {o1 d} {::o1: unable to dispatch method 'd'} ? {o1 eval ":a"} {::o1: unable to dispatch method 'a'} - ? {o1 eval ":b"} b1 - ? {o1 eval ":c"} c1 + ? {o1 eval ":b get"} b1 + ? {o1 eval ":c get"} c1 ? {o1 eval ":d"} {::o1: unable to dispatch method 'd'} ? {o1 va} {::o1: unable to dispatch method 'va'} - ? {o1 vb} vb1 + ? {o1 vb get} vb1 ? {o1 vc} {::o1: unable to dispatch method 'vc'} ? {o1 vd} {::o1: unable to dispatch method 'vd'} ? {o1 eval ":va"} {::o1: unable to dispatch method 'va'} - ? {o1 eval ":vb"} vb1 - ? {o1 eval ":vc"} vc1 + ? {o1 eval ":vb get"} vb1 + ? {o1 eval ":vc get"} vc1 ? {o1 eval ":vd"} {::o1: unable to dispatch method 'vd'} # @@ -526,7 +526,7 @@ :object variable -accessor private -incremental vd vd1 :object variable -accessor none -incremental ve ve1 - :public object method call-local {v} {: -local $v} + :public object method call-local {v} {: -local $v get} :public object method add-local {var value} {: -local $var add $value} } @@ -597,25 +597,25 @@ # can we call the accessor directly or via "eval" # - ? {o1 a} a1 - ? {o1 b} b1 + ? {o1 a get} a1 + ? {o1 b get} b1 ? {o1 c} {::o1: unable to dispatch method 'c'} ? {o1 d} {::o1: unable to dispatch method 'd'} - ? {o1 eval ":a"} a1 - ? {o1 eval ":b"} b1 - ? {o1 eval ":c"} c1 + ? {o1 eval ":a get"} a1 + ? {o1 eval ":b get"} b1 + ? {o1 eval ":c get"} c1 ? {o1 eval ":d"} {::o1: unable to dispatch method 'd'} - ? {o1 va} va1 - ? {o1 vb} vb1 + ? {o1 va get} va1 + ? {o1 vb get} vb1 ? {o1 vc} {::o1: unable to dispatch method 'vc'} ? {o1 vd} {::o1: unable to dispatch method 'vd'} - ? {o1 eval ":va"} va1 - ? {o1 eval ":vb"} vb1 - ? {o1 eval ":vc"} vc1 + ? {o1 eval ":va get"} va1 + ? {o1 eval ":vb get"} vb1 + ? {o1 eval ":vc get"} vc1 ? {o1 eval ":vd"} {::o1: unable to dispatch method 'vd'} # @@ -659,7 +659,7 @@ # The accessor should be a forwarder due to incremental # - ? {o1 info object method definition b} {::o1 public object forward b ::o1::per-object-slot::b {%1 {get assign}} %self b} + ? {o1 info object method definition b} {::o1 public object forward b ::o1::per-object-slot::b %1 %self b} # # check error message @@ -685,7 +685,7 @@ } ? {o1 a add x} {x a1} - ? {o1 a {a1}} {a1} + ? {o1 a assign {a1}} {a1} nsf::configure debug 2 ? {o1 a value add x } {x a1} @@ -722,13 +722,13 @@ ? {o1 info variable definition [o1 info object variables d]} \ "::o1 object property -accessor public -incremental d:integer,1..n" - ? {o1 a {1 2 3}} {1 2 3} - ? {o1 b {1 2 3}} {1 2 3} + ? {o1 a assign {1 2 3}} {1 2 3} + ? {o1 b assign {1 2 3}} {1 2 3} - ? {o1 a ""} {} - ? {o1 b ""} {invalid value for parameter 'value': list is not allowed to be empty} - ? {o1 c ""} {} - ? {o1 d ""} {invalid value for parameter 'value': list is not allowed to be empty} + ? {o1 a assign ""} {} + ? {o1 b assign ""} {invalid value for parameter 'value': list is not allowed to be empty} + ? {o1 c assign ""} {} + ? {o1 d assign ""} {invalid value for parameter 'value': list is not allowed to be empty} } @@ -882,8 +882,8 @@ ? {o1 cget -a} a1 ? {o1 configure -a a2} "" - ? {o1 b} b1 - ? {o1 b b2} "b2" + ? {o1 b get} b1 + ? {o1 b assign b2} "b2" ? {o1 configure -class ::nx::Object} "" ? {o1 cget -class} ::nx::Object Index: tests/submethods.test =================================================================== diff -u -rcd33e8cefca1d52063ebcb6689e46527bb94e33d -r85ee1fdb043ed3f82fd272cc004c476c40861fdb --- tests/submethods.test (.../submethods.test) (revision cd33e8cefca1d52063ebcb6689e46527bb94e33d) +++ tests/submethods.test (.../submethods.test) (revision 85ee1fdb043ed3f82fd272cc004c476c40861fdb) @@ -493,7 +493,7 @@ # filter-local argv. Class create Z { - :object property -accessor public msg + :object property msg :method intercept args { [current class] eval [list set :msg [list [lrange [current methodpath] 1 end-1] \ [current calledmethod] \ @@ -512,7 +512,7 @@ set root [lindex $selector 0] set mh [Z info method registrationhandle $root] $c {*}$selector - ? [list set _ [join [Z msg] -]] -$root-::Z-$mh + ? [list set _ [join [Z cget -msg] -]] -$root-::Z-$mh } Z filter {}