Index: xotcl/ChangeLog =================================================================== diff -u -r9722a51911e1502444c173306c8c88f7f3888989 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/ChangeLog (.../ChangeLog) (revision 9722a51911e1502444c173306c8c88f7f3888989) +++ xotcl/ChangeLog (.../ChangeLog) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,3 +1,26 @@ +2004-07-03 Gustaf.Neumann@wu-wien.ac.at + * extended commands filter, mixin, instfilter, instmixin: + These commands are changed in a backward compatible manner. They + can be used as follows + + obj mixin: same as: obj info mixin + obj mixin {C1 C2} same as: obj mixin set {C1 C2} + obj mixin set {C1 C2} sets the mixins for obj + obj mixin get {C1 C2} same as: obj info mixin + obj mixin add C3 adds a mixin on front of the mixin list + obj mixin add C3 end adds a mixin at the end the mixin list + obj mixin add C3 3 adds a mixin at the 3rd position + obj mixin delete ::C3 removes the mixin from the mixin list + + The same semantics are available as well for filter, instmixin + and instfilter. + The implementation uses the forwarder and is extensible, new + subcommands can be added. As a side effect, the c-code was reduced + by 50 lines. + * the commands mixinappend, filterappend, instmixinappend and + instfilterappend were marked as deprecated and will be removed + in future versions + 2004-07-02 Gustaf.Neumann@wu-wien.ac.at * rename forward option -inscope to -objscope * xotcl.c: added current namespace prefix, when a forwarder is Index: xotcl/Makefile =================================================================== diff -u -r9722a51911e1502444c173306c8c88f7f3888989 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/Makefile (.../Makefile) (revision 9722a51911e1502444c173306c8c88f7f3888989) +++ xotcl/Makefile (.../Makefile) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: Makefile,v 1.9 2004/07/02 11:22:31 neumann Exp $ +# RCS: @(#) $Id: Makefile,v 1.10 2004/07/03 21:19:39 neumann Exp $ #======================================================================== # Add additional lines to handle any additional AC_SUBST cases that @@ -118,7 +118,7 @@ PACKAGE_NAME = xotcl PACKAGE_VERSION = 1.2.1 CC = gcc -pipe -CFLAGS_DEFAULT = -O +CFLAGS_DEFAULT = -O -g CFLAGS_WARNING = -Wall -Wconversion -Wno-implicit-int CLEANFILES = *.o *.a *.so *~ core gmon.out config.* EXEEXT = Index: xotcl/generic/predefined.h =================================================================== diff -u -r9722a51911e1502444c173306c8c88f7f3888989 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/generic/predefined.h (.../predefined.h) (revision 9722a51911e1502444c173306c8c88f7f3888989) +++ xotcl/generic/predefined.h (.../predefined.h) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,5 +1,5 @@ static char cmd[] = -"# $Id: predefined.h,v 1.2 2004/07/02 11:22:31 neumann Exp $\n" +"# $Id: predefined.h,v 1.3 2004/07/03 21:19:39 neumann Exp $\n" "::xotcl::Object instproc init args {}\n" "::xotcl::Object create ::xotcl::@\n" "::xotcl::@ proc unknown args {}\n" @@ -8,23 +8,49 @@ "::xotcl::Object instforward $cmd -objscope}\n" "::xotcl::Object instproc tclcmd {t} {\n" "set cmd [list [::xotcl::self] forward $t -objscope]\n" -"puts stderr \"the method tclcmd is deprecated; use instead '$cmd'\"\n" +"puts stderr \"the method [::xotcl::self proc] is deprecated; use instead '$cmd'\"\n" "eval $cmd}\n" "::xotcl::Class instproc insttclcmd {t} {\n" "set cmd [list [::xotcl::self] instforward $t -objscope]\n" -"puts stderr \"the method tclcmd is deprecated; use instead '$cmd'\"\n" +"puts stderr \"the method [::xotcl::self proc] is deprecated; use instead '$cmd'\"\n" "eval $cmd}\n" +"::xotcl::Class ::xotcl::Relations\n" +"::xotcl::Relations instproc get {obj prop} {$obj info $prop}\n" +"::xotcl::Relations instproc set {obj prop value} {::xotcl::setrelation $obj $prop $value}\n" +"::xotcl::Relations instproc add {obj prop value {pos 0}} {\n" +"$obj $prop [linsert [$obj info $prop -guards] $pos $value]}\n" +"::xotcl::Relations instproc delete {obj prop value} {\n" +"set old [$obj info $prop]\n" +"set p [lsearch -glob $old $value]\n" +"if {$p>-1} {$obj $prop [lreplace $old $p $p]} else {\n" +"error \"$value is not a $prop of $obj (valid are: $old)\"}}\n" +"::xotcl::Relations instproc unknown {m args} {\n" +"puts \"method '$m' unknown for [self]\"\n" +"puts \" valid commands are: {[lsort [my info procs]]}\"}\n" +"::xotcl::Relations create ::xotcl::relmgr -requireNamespace\n" +"::xotcl::Object instforward mixin -default [list get set] xotcl::relmgr %1 %self %proc\n" +"::xotcl::Object instforward filter -default [list get set] xotcl::relmgr %1 %self %proc\n" +"::xotcl::Class instforward instmixin -default [list get set] xotcl::relmgr %1 %self %proc\n" +"::xotcl::Class instforward instfilter -default [list get set] xotcl::relmgr %1 %self %proc\n" "::xotcl::Object instproc self {} {return [::xotcl::self]}\n" "::xotcl::Object instproc defaultmethod {} {\n" "return [::xotcl::self]}\n" "::xotcl::Object instproc filterappend f {\n" -"::xotcl::my filter [concat [::xotcl::my info filter -guards] $f]}\n" +"set cmd [list [::xotcl::self] filter add $f end]\n" +"puts stderr \"the method [::xotcl::self proc] is deprecated; use instead '$cmd'\"\n" +"eval $cmd}\n" "::xotcl::Object instproc mixinappend m {\n" -"::xotcl::my mixin [concat [::xotcl::my info mixin] $m]}\n" +"set cmd [list [::xotcl::self] mixin add $m end]\n" +"puts stderr \"the method [::xotcl::self proc] is deprecated; use instead '$cmd'\"\n" +"eval $cmd}\n" "::xotcl::Class instproc instfilterappend f {\n" -"::xotcl::my instfilter [concat [::xotcl::my info instfilter -guards] $f]}\n" +"set cmd [list [::xotcl::self] instfilter add $f end]\n" +"puts stderr \"the method [::xotcl::self proc] is deprecated; use instead '$cmd'\"\n" +"eval $cmd}\n" "::xotcl::Class instproc instmixinappend m {\n" -"::xotcl::my instmixin [concat [::xotcl::my info instmixin] $m]}\n" +"set cmd [list [::xotcl::self] instmixin add $m end]\n" +"puts stderr \"the method [::xotcl::self proc] is deprecated; use instead '$cmd'\"\n" +"eval $cmd}\n" "::xotcl::Object instproc hasclass cl {\n" "if {[::xotcl::my ismixin $cl]} {return 1}\n" "::xotcl::my istype $cl}\n" Index: xotcl/generic/predefined.xotcl =================================================================== diff -u -r9722a51911e1502444c173306c8c88f7f3888989 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/generic/predefined.xotcl (.../predefined.xotcl) (revision 9722a51911e1502444c173306c8c88f7f3888989) +++ xotcl/generic/predefined.xotcl (.../predefined.xotcl) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,4 +1,4 @@ -# $Id: predefined.xotcl,v 1.2 2004/07/02 11:22:31 neumann Exp $ +# $Id: predefined.xotcl,v 1.3 2004/07/03 21:19:39 neumann Exp $ # init must exist on Object. per default it is empty. ::xotcl::Object instproc init args {} @@ -26,15 +26,42 @@ } ::xotcl::Object instproc tclcmd {t} { set cmd [list [::xotcl::self] forward $t -objscope] - puts stderr "the method tclcmd is deprecated; use instead '$cmd'" + puts stderr "the method [::xotcl::self proc] is deprecated; use instead '$cmd'" eval $cmd } ::xotcl::Class instproc insttclcmd {t} { set cmd [list [::xotcl::self] instforward $t -objscope] - puts stderr "the method tclcmd is deprecated; use instead '$cmd'" + puts stderr "the method [::xotcl::self proc] is deprecated; use instead '$cmd'" eval $cmd } +# define commenad for relations between classes and methods +::xotcl::Class ::xotcl::Relations +::xotcl::Relations instproc get {obj prop} {$obj info $prop} +::xotcl::Relations instproc set {obj prop value} {::xotcl::setrelation $obj $prop $value} +::xotcl::Relations instproc add {obj prop value {pos 0}} { + $obj $prop [linsert [$obj info $prop -guards] $pos $value] +} +::xotcl::Relations instproc delete {obj prop value} { + set old [$obj info $prop] + set p [lsearch -glob $old $value] + if {$p>-1} {$obj $prop [lreplace $old $p $p]} else { + error "$value is not a $prop of $obj (valid are: $old)" + } +} +::xotcl::Relations instproc unknown {m args} { + puts "method '$m' unknown for [self]" + puts " valid commands are: {[lsort [my info procs]]}" +} +::xotcl::Relations create ::xotcl::relmgr -requireNamespace + +::xotcl::Object instforward mixin -default [list get set] xotcl::relmgr %1 %self %proc +::xotcl::Object instforward filter -default [list get set] xotcl::relmgr %1 %self %proc +::xotcl::Class instforward instmixin -default [list get set] xotcl::relmgr %1 %self %proc +::xotcl::Class instforward instfilter -default [list get set] xotcl::relmgr %1 %self %proc + + + ::xotcl::Object instproc self {} {return [::xotcl::self]} ::xotcl::Object instproc defaultmethod {} { #if {[string compare "::" [::xotcl::my info parent]]} { @@ -45,16 +72,24 @@ # support for XOTcl specifics ::xotcl::Object instproc filterappend f { - ::xotcl::my filter [concat [::xotcl::my info filter -guards] $f] + set cmd [list [::xotcl::self] filter add $f end] + puts stderr "the method [::xotcl::self proc] is deprecated; use instead '$cmd'" + eval $cmd } ::xotcl::Object instproc mixinappend m { - ::xotcl::my mixin [concat [::xotcl::my info mixin] $m] + set cmd [list [::xotcl::self] mixin add $m end] + puts stderr "the method [::xotcl::self proc] is deprecated; use instead '$cmd'" + eval $cmd } ::xotcl::Class instproc instfilterappend f { - ::xotcl::my instfilter [concat [::xotcl::my info instfilter -guards] $f] + set cmd [list [::xotcl::self] instfilter add $f end] + puts stderr "the method [::xotcl::self proc] is deprecated; use instead '$cmd'" + eval $cmd } ::xotcl::Class instproc instmixinappend m { - ::xotcl::my instmixin [concat [::xotcl::my info instmixin] $m] + set cmd [list [::xotcl::self] instmixin add $m end] + puts stderr "the method [::xotcl::self proc] is deprecated; use instead '$cmd'" + eval $cmd } ::xotcl::Object instproc hasclass cl { if {[::xotcl::my ismixin $cl]} {return 1} Index: xotcl/generic/xotcl.c =================================================================== diff -u -r9722a51911e1502444c173306c8c88f7f3888989 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/generic/xotcl.c (.../xotcl.c) (revision 9722a51911e1502444c173306c8c88f7f3888989) +++ xotcl/generic/xotcl.c (.../xotcl.c) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,4 +1,4 @@ -/* $Id: xotcl.c,v 1.10 2004/07/02 11:22:31 neumann Exp $ +/* $Id: xotcl.c,v 1.11 2004/07/03 21:19:39 neumann Exp $ * * XOTcl - Extended OTcl * @@ -7356,83 +7356,110 @@ } static int -XOTclOMixinMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *objv[]) { +XOTclSetrelationCommand(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { int oc; Tcl_Obj **ov; - XOTclObject *obj = (XOTclObject*)cd; - int i, result = TCL_OK; - XOTclObjectOpt *opt; + XOTclObject *obj = NULL; + XOTclClass *cl = NULL; + int i, len, result = TCL_OK; + char *reltype; + enum {mixin, filter, instmixin, instfilter} kind = 0; - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 2) - return XOTclObjErrArgCnt(in, obj->cmdName, "mixin ?args?"); - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (Tcl_ListObjGetElements(in, objv[1], &oc, &ov)!= TCL_OK) + if (objc < 3) + return XOTclObjErrArgCnt(in, objv[0], "::xotcl::setrelation obj ?reltype? classes"); + if (Tcl_ListObjGetElements(in, objv[3], &oc, &ov)!= TCL_OK) return TCL_ERROR; - if (obj->opt) { - CmdListRemoveList(&obj->opt->mixins, GuardDel); + reltype = ObjStr(objv[2]); + len = strlen(reltype); + + if (*reltype == 'm' && len == 5 && !strcmp(reltype, "mixin")) { + kind = mixin; + } else if (*reltype == 'f' && len == 6 && !strcmp(reltype, "filter")) { + kind = filter; + } else if (*reltype == 'i' && len == 9 && !strcmp(reltype, "instmixin")) { + kind = instmixin; + } else if (*reltype == 'i' && len == 10 && !strcmp(reltype, "instfilter")) { + kind = instfilter; + } else { + XOTclObjErrType(in, objv[2], "reltype (mixin, filter, instmixin, instfilter)"); } - - obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; - opt = XOTclRequireObjectOpt(obj); - - /* - * since mixin procs may be used as filters -> we have to invalidate - */ - obj->flags &= ~XOTCL_FILTER_ORDER_VALID; - - for (i = 0; i < oc; i++) { - result = MixinAdd(in, &opt->mixins, ov[i]); - /*CmdListPrint("object mixins\n", opt->mixins);*/ - if (result != TCL_OK) - return result; + + if (kind == mixin || kind == filter) { + GetXOTclObjectFromObj(in, objv[1], &obj); + if (!obj) return XOTclObjErrType(in, objv[1], "Object"); + } else { + GetXOTclClassFromObj(in, objv[1], &cl, 1); + if (!cl) return XOTclObjErrType(in, objv[1], "Class"); } - MixinComputeDefined(in, obj); - FilterComputeDefined(in, obj); + switch (kind) { + case mixin: + { + XOTclObjectOpt *opt = XOTclRequireObjectOpt(obj); + if (opt->mixins) CmdListRemoveList(&obj->opt->mixins, GuardDel); + + obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; + /* + * since mixin procs may be used as filters -> we have to invalidate + */ + obj->flags &= ~XOTCL_FILTER_ORDER_VALID; - return result; -} + for (i = 0; i < oc; i++) { + if ((result = MixinAdd(in, &opt->mixins, ov[i])) != TCL_OK) + return result; + } + + MixinComputeDefined(in, obj); + FilterComputeDefined(in, obj); + break; + } + case filter: + { + XOTclObjectOpt *opt = XOTclRequireObjectOpt(obj); + if (opt->filters) CmdListRemoveList(&obj->opt->filters, GuardDel); + + obj->flags &= ~XOTCL_FILTER_ORDER_VALID; + for (i = 0; i < oc; i ++) { + if ((result = FilterAdd(in, &opt->filters, ov[i], obj, 0)) != TCL_OK) + return result; + } + /*FilterComputeDefined(in, obj);*/ + break; + } -static int -XOTclMixinCommand(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - int oc; Tcl_Obj **ov; - XOTclObject *obj; - int i, result = TCL_OK; - XOTclObjectOpt *opt; + case instmixin: + { + XOTclClassOpt* opt = XOTclRequireClassOpt(cl); + if (opt->instmixins) CmdListRemoveList(&opt->instmixins, GuardDel); - if (objc < 3) - return XOTclObjErrArgCnt(in, objv[0], "::xotcl::setrelation obj mixin classes"); + MixinInvalidateObjOrders(cl); + /* + * since mixin procs may be used as filters -> we have to invalidate + */ + FilterInvalidateObjOrders(in, cl); - GetXOTclObjectFromObj(in, objv[1], &obj); - if (!obj) return XOTclObjErrType(in, objv[1], "Object"); - - if (Tcl_ListObjGetElements(in, objv[3], &oc, &ov)!= TCL_OK) - return TCL_ERROR; + for (i = 0; i < oc; i++) { + if ((result = MixinAdd(in, &opt->instmixins, ov[i])) != TCL_OK) + return result; + } + break; + } + case instfilter: + { + XOTclClassOpt* opt = XOTclRequireClassOpt(cl); + if (opt->instfilters) CmdListRemoveList(&opt->instfilters, GuardDel); - if (obj->opt) { - CmdListRemoveList(&obj->opt->mixins, GuardDel); - } + FilterInvalidateObjOrders(in, cl); + opt = XOTclRequireClassOpt(cl); - obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; - opt = XOTclRequireObjectOpt(obj); - - /* - * since mixin procs may be used as filters -> we have to invalidate - */ - obj->flags &= ~XOTCL_FILTER_ORDER_VALID; - - for (i = 0; i < oc; i++) { - result = MixinAdd(in, &opt->mixins, ov[i]); - /*CmdListPrint("object mixins\n", opt->mixins);*/ - if (result != TCL_OK) - return result; + for (i = 0; i < oc; i ++) { + if ((result = FilterAdd(in, &opt->instfilters, ov[i], 0, cl)) != TCL_OK) + return result; + } + break; + } } - MixinComputeDefined(in, obj); - FilterComputeDefined(in, obj); - return result; } @@ -7470,36 +7497,7 @@ ObjStr(objv[1]), " on ", ObjStr(obj->cmdName), NULL); } -static int -XOTclOFilterMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *objv[]) { - int oc; Tcl_Obj **ov; - XOTclObject *obj = (XOTclObject*)cd; - int i, result = TCL_OK; - XOTclObjectOpt *opt; - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 2) - return XOTclObjErrArgCnt(in, obj->cmdName, "filter filterNameList"); - - if (Tcl_ListObjGetElements(in, objv[1], &oc, &ov) != TCL_OK) - return TCL_ERROR; - - if (obj->opt) { - CmdListRemoveList(&obj->opt->filters, GuardDel); - } - - obj->flags &= ~XOTCL_FILTER_ORDER_VALID; - opt = XOTclRequireObjectOpt(obj); - - for (i = 0; i < oc; i ++) { - result = FilterAdd(in, &opt->filters, ov[i], obj, 0); - if (result != TCL_OK) - return result; - } - /*FilterComputeDefined(in, obj);*/ - return result; -} - static int XOTclOFilterGuardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *objv[]) { XOTclObject *obj = (XOTclObject*)cd; @@ -8750,35 +8748,7 @@ return TCL_OK; } -static int -XOTclCInstFilterMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - int i, result = TCL_OK; - Tcl_Obj **ov; int oc; - XOTclClassOpt* opt; - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc < 2) return XOTclObjErrArgCnt(in, cl->object.cmdName, - "instfilter filterNameList"); - - if (Tcl_ListObjGetElements(in, objv[1], &oc, &ov) != TCL_OK) - return TCL_ERROR; - - opt = cl->opt; - if (opt) - CmdListRemoveList(&opt->instfilters, GuardDel); - - FilterInvalidateObjOrders(in, cl); - opt = XOTclRequireClassOpt(cl); - - for (i = 0; i < oc; i ++) { - result = FilterAdd(in, &opt->instfilters, ov[i], 0, cl); - if (result != TCL_OK) - return result; - } - return result; -} - static int XOTclCInstFilterGuardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *objv[]) { XOTclClass *cl = XOTclObjectToClass(cd); @@ -8807,38 +8777,6 @@ static int -XOTclCInstMixinMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *objv[]) { - int oc; Tcl_Obj **ov; - XOTclClass *cl = XOTclObjectToClass(cd); - int i, result = TCL_OK; - XOTclClassOpt* opt; - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc < 2) return XOTclObjErrArgCnt(in, cl->object.cmdName, - "instmixin classList"); - - if (Tcl_ListObjGetElements(in, objv[1], &oc, &ov)!= TCL_OK) - return TCL_ERROR; - - if ((opt = cl->opt)) - CmdListRemoveList(&opt->instmixins, GuardDel); - - MixinInvalidateObjOrders(cl); - /* - * since mixin procs may be used as filters -> we have to invalidate - */ - FilterInvalidateObjOrders(in, cl); - - opt = XOTclRequireClassOpt(cl); - for (i = 0; i < oc; i++) { - result = MixinAdd(in, &opt->instmixins, ov[i]); - if (result != TCL_OK) - return result; - } - return result; -} - -static int XOTclCInstMixinGuardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *objv[]) { XOTclClass *cl = XOTclObjectToClass(cd); XOTclCmdList* h; @@ -9804,7 +9742,7 @@ Tcl_Export(in, RUNTIME_STATE(in)->XOTclNS, "my", 0); /* for the time being, should be registered as method "set" of :xotcl::mixin */ - Tcl_CreateObjCommand(in, "::xotcl::setrelation", XOTclMixinCommand, 0, 0); + Tcl_CreateObjCommand(in, "::xotcl::setrelation", XOTclSetrelationCommand, 0, 0); #if defined(PROFILE) XOTclProfileInit(in); @@ -9840,7 +9778,6 @@ XOTclAddIMethod(in, (XOTcl_Class*) theobj, "configure", (Tcl_ObjCmdProc*) XOTclOConfigureMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) theobj, "destroy", XOTclODestroyMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) theobj, "exists", (Tcl_ObjCmdProc*)XOTclOExistsMethod, 0, 0); - XOTclAddIMethod(in, (XOTcl_Class*) theobj, "filter", (Tcl_ObjCmdProc*)XOTclOFilterMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) theobj, "filterguard", (Tcl_ObjCmdProc*)XOTclOFilterGuardMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) theobj, "filtersearch", (Tcl_ObjCmdProc*)XOTclOFilterSearchMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) theobj, "incr", (Tcl_ObjCmdProc*)XOTclOIncrMethod, 0, 0); @@ -9855,7 +9792,6 @@ #ifdef XOTCL_METADATA XOTclAddIMethod(in, (XOTcl_Class*) theobj, "metadata", (Tcl_ObjCmdProc*)XOTclOMetaDataMethod, 0, 0); #endif - XOTclAddIMethod(in, (XOTcl_Class*) theobj, "mixin", (Tcl_ObjCmdProc*)XOTclOMixinMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) theobj, "mixinguard", (Tcl_ObjCmdProc*)XOTclOMixinGuardMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) theobj, "__next", (Tcl_ObjCmdProc*)XOTclONextMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) theobj, "noinit", (Tcl_ObjCmdProc*)XOTclONoinitMethod, 0, 0); @@ -9881,10 +9817,8 @@ XOTclAddIMethod(in, (XOTcl_Class*) thecls, "new", (Tcl_ObjCmdProc*)XOTclCNewMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) thecls, "info", XOTclCInfoMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) thecls, "instdestroy", XOTclCInstDestroyMethod, 0, 0); - XOTclAddIMethod(in, (XOTcl_Class*) thecls, "instfilter", (Tcl_ObjCmdProc*)XOTclCInstFilterMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) thecls, "instfilterguard", (Tcl_ObjCmdProc*)XOTclCInstFilterGuardMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) thecls, "instinvar", (Tcl_ObjCmdProc*)XOTclCInvariantsMethod, 0, 0); - XOTclAddIMethod(in, (XOTcl_Class*) thecls, "instmixin", (Tcl_ObjCmdProc*)XOTclCInstMixinMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) thecls, "instmixinguard", (Tcl_ObjCmdProc*)XOTclCInstMixinGuardMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) thecls, "instparametercmd", (Tcl_ObjCmdProc*)XOTclCInstParameterCmdMethod, 0, 0); XOTclAddIMethod(in, (XOTcl_Class*) thecls, "instproc", (Tcl_ObjCmdProc*)XOTclCInstProcMethod, 0, 0); Index: xotcl/library/actiweb/PlaceAccessControl.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/library/actiweb/PlaceAccessControl.xotcl (.../PlaceAccessControl.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/actiweb/PlaceAccessControl.xotcl (.../PlaceAccessControl.xotcl) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,4 +1,4 @@ -# $Id: PlaceAccessControl.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# $Id: PlaceAccessControl.xotcl,v 1.2 2004/07/03 21:19:39 neumann Exp $ package provide xotcl::actiweb::placeAccessControl 0.8 package require xotcl::comm::httpd @@ -43,7 +43,7 @@ Class PlaceAccessControl PlaceAccessControl instproc init args { next - [self]::httpd mixinappend ObjectAccessControl + [self]::httpd mixin add ObjectAccessControl [self]::httpd initWorkerMixins } Index: xotcl/library/patterns/ChainOfResponsibility.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/library/patterns/ChainOfResponsibility.xotcl (.../ChainOfResponsibility.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/patterns/ChainOfResponsibility.xotcl (.../ChainOfResponsibility.xotcl) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,4 +1,4 @@ -# $Id: ChainOfResponsibility.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# $Id: ChainOfResponsibility.xotcl,v 1.2 2004/07/03 21:19:39 neumann Exp $ package provide xotcl::pattern::chainOfResponsibility 0.9 Class ChainOfResponsibility -superclass Class @@ -28,7 +28,7 @@ } ChainOfResponsibility instproc init args { - my instfilterappend chainingFilter + my instfilter add chainingFilter my parameter {successor} # chained operations hold their value of failure my array set chainedOperations {} @@ -40,4 +40,4 @@ ChainOfResponsibility instproc removeChainedOperation {name} { my unset chainedOperations($name) -} \ No newline at end of file +} Index: xotcl/library/patterns/OnCalleeProxy.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/library/patterns/OnCalleeProxy.xotcl (.../OnCalleeProxy.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/patterns/OnCalleeProxy.xotcl (.../OnCalleeProxy.xotcl) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,4 +1,4 @@ -# $Id: OnCalleeProxy.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# $Id: OnCalleeProxy.xotcl,v 1.2 2004/07/03 21:19:39 neumann Exp $ package provide xotcl::pattern::onCalleeProxy 0.8 Class OnCalleeProxy -superclass Class @@ -23,7 +23,7 @@ } OnCalleeProxy instproc init args { - my instfilterappend onCalleeProxyFilter + my instfilter add onCalleeProxyFilter next my instproc setCallee {callingObj a} { my set callee([string trimleft $callingObj :]) $a Index: xotcl/library/patterns/Singleton.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/library/patterns/Singleton.xotcl (.../Singleton.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/patterns/Singleton.xotcl (.../Singleton.xotcl) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,4 +1,4 @@ -# $Id: Singleton.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# $Id: Singleton.xotcl,v 1.2 2004/07/03 21:19:39 neumann Exp $ package provide xotcl::pattern::singleton 0.8 Class SingletonBase @@ -57,7 +57,7 @@ } Singleton instproc init args { - my instfilterappend singletonFilter + my instfilter add singletonFilter # # specialized singletons have to look up the singleton class # first @@ -73,4 +73,4 @@ next } - \ No newline at end of file + Index: xotcl/library/patterns/SortedComposite.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/library/patterns/SortedComposite.xotcl (.../SortedComposite.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/patterns/SortedComposite.xotcl (.../SortedComposite.xotcl) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,4 +1,4 @@ -# $Id: SortedComposite.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# $Id: SortedComposite.xotcl,v 1.2 2004/07/03 21:19:39 neumann Exp $ package provide xotcl::pattern::sortedCompositeWithAfter 0.9 Class SortedComposite -superclass Class @@ -65,6 +65,6 @@ } next - my instfilterappend compositeFilter + my instfilter add compositeFilter } Index: xotcl/library/patterns/adapter.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/library/patterns/adapter.xotcl (.../adapter.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/patterns/adapter.xotcl (.../adapter.xotcl) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,4 +1,4 @@ -# $Id: adapter.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# $Id: adapter.xotcl,v 1.2 2004/07/03 21:19:39 neumann Exp $ package provide xotcl::pattern::adapter 0.9 Class Adapter -superclass Class @@ -22,7 +22,7 @@ } Adapter instproc init args { - my instfilterappend adapterFilter + my instfilter add adapterFilter next my instproc setRequest {r sr} { my set specificRequest($r) $sr Index: xotcl/library/patterns/composite.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/library/patterns/composite.xotcl (.../composite.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/patterns/composite.xotcl (.../composite.xotcl) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,4 +1,4 @@ -# $Id: composite.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# $Id: composite.xotcl,v 1.2 2004/07/03 21:19:39 neumann Exp $ package provide xotcl::pattern::composite 0.9 Class Composite -superclass Class @@ -48,7 +48,7 @@ Composite instproc init {args} { my array set operations {} next - my instfilterappend compositeFilter + my instfilter add compositeFilter } Index: xotcl/library/rdf/xoRDF.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/library/rdf/xoRDF.xotcl (.../xoRDF.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/rdf/xoRDF.xotcl (.../xoRDF.xotcl) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,4 +1,4 @@ -# $Id: xoRDF.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# $Id: xoRDF.xotcl,v 1.2 2004/07/03 21:19:39 neumann Exp $ package provide xotcl::rdf::parser 0.9 package require xotcl::xml::parser @@ -130,7 +130,7 @@ # RDFNode instproc init args { next - my mixinappend RDFNodeParseTypeHandling + my mixin add RDFNodeParseTypeHandling set p [my info parent] if {[$p exists rdfNSPrefix]} { my set rdfNSPrefix [$p set rdfNSPrefix] @@ -724,7 +724,7 @@ } RDFParser instproc init args { - my mixinappend RDFParserParseTypeHandling + my mixin add RDFParserParseTypeHandling ### this special parser handles rdf:RDF tags my topLevelHandlerPattern {^([^:]*):RDF|RDF} RDFTag Index: xotcl/tests/testx.xotcl =================================================================== diff -u -r9722a51911e1502444c173306c8c88f7f3888989 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 9722a51911e1502444c173306c8c88f7f3888989) +++ xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,4 +1,4 @@ -#$Id: testx.xotcl,v 1.9 2004/07/02 11:22:31 neumann Exp $ +#$Id: testx.xotcl,v 1.10 2004/07/03 21:19:39 neumann Exp $ package require XOTcl namespace import -force xotcl::* @@ -1902,11 +1902,11 @@ Object instfilter "" ::errorCheck $::calling \ - "{filter f: ::mixinTest {} run draw {::MenuDecorator instproc draw}} {m1 draw: ::mixinTest {} run {::ScrollBarDecorator instproc draw}} {m2 draw: ::mixinTest {} run {::Image instproc draw}} {image draw: ::mixinTest {} run {::GrObject instproc draw}} {grObject draw: ::mixinTest {} run {}} {filter f: ::mixinTest {} run draw {::ScrollBarDecorator instproc draw}} {m2 draw: ::mixinTest {} run {::Image instproc draw}} {image draw: ::mixinTest {} run {::GrObject instproc draw}} {grObject draw: ::mixinTest {} run {}} {filter f: ::mixinTest {} run instfilter {::xotcl::Class instproc instfilter}}" \ + "{filter f: ::mixinTest {} run draw {::MenuDecorator instproc draw}} {m1 draw: ::mixinTest {} run {::ScrollBarDecorator instproc draw}} {m2 draw: ::mixinTest {} run {::Image instproc draw}} {image draw: ::mixinTest {} run {::GrObject instproc draw}} {grObject draw: ::mixinTest {} run {}} {filter f: ::mixinTest {} run draw {::ScrollBarDecorator instproc draw}} {m2 draw: ::mixinTest {} run {::Image instproc draw}} {image draw: ::mixinTest {} run {::GrObject instproc draw}} {grObject draw: ::mixinTest {} run {}} {filter f: ::mixinTest {} run instfilter {::xotcl::Class instproc instfilter}} {filter f: ::xotcl::Object ::xotcl::Class instfilter set {::xotcl::Relations instproc set}}" \ "Mixin: Calling-Obj/Cl/Proc failed" ::errorCheck "$::mixinResult" \ - "{filter ::mainImage f ::xotcl::Object} {m1 ::mainImage draw ::MenuDecorator} {m2 ::mainImage draw ::ScrollBarDecorator} {image ::mainImage draw ::Image} {grObject ::mainImage draw ::GrObject} {filter ::zoom f ::xotcl::Object} {m2 ::zoom draw ::ScrollBarDecorator} {image ::zoom draw ::Image} {grObject ::zoom draw ::GrObject} {filter ::xotcl::Object f ::xotcl::Object}" \ + "{filter ::mainImage f ::xotcl::Object} {m1 ::mainImage draw ::MenuDecorator} {m2 ::mainImage draw ::ScrollBarDecorator} {image ::mainImage draw ::Image} {grObject ::mainImage draw ::GrObject} {filter ::zoom f ::xotcl::Object} {m2 ::zoom draw ::ScrollBarDecorator} {image ::zoom draw ::Image} {grObject ::zoom draw ::GrObject} {filter ::xotcl::Object f ::xotcl::Object} {filter ::xotcl::relmgr f ::xotcl::Object}" \ "Mixin: Filter failed" set ::mixinResult "" @@ -2253,7 +2253,7 @@ "Mixin init 4 failed" set initResult "" - B mixinappend Mix2 + B mixin add Mix2 ::errorCheck $initResult \ "" \ "Mixin init 5 failed"