Index: generic/gentclAPI.decls =================================================================== diff -u -r901ceb8f58714e31d28ed3277923fc69c085d252 -r464811a4aaa475de10e834b0a009521446163fc0 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 901ceb8f58714e31d28ed3277923fc69c085d252) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision 464811a4aaa475de10e834b0a009521446163fc0) @@ -83,7 +83,7 @@ } xotclCmd is XOTclIsCmd { {-argName "object" -required 1 -type tclobj} - {-argName "objectkind" -type "type|object|class|baseclass|metaclass|mixin"} + {-argName "objectkind" -type "type|object|class|baseclass|metaclass|hasmixin"} {-argName "value" -required 0 -type tclobj} } xotclCmd method XOTclMethodCmd { Index: generic/predefined.h =================================================================== diff -u -r901ceb8f58714e31d28ed3277923fc69c085d252 -r464811a4aaa475de10e834b0a009521446163fc0 --- generic/predefined.h (.../predefined.h) (revision 901ceb8f58714e31d28ed3277923fc69c085d252) +++ generic/predefined.h (.../predefined.h) (revision 464811a4aaa475de10e834b0a009521446163fc0) @@ -438,8 +438,8 @@ "::xotcl::Attribute createFromParameterSyntax [self] {*}$arg}\n" "::xotcl::setinstvar [::xotcl::self]::slot __parameter $arglist}\n" "proc createBootstrapAttributeSlots {} {}\n" -"::xotcl::Slot method type=mixin {name value arg} {\n" -"if {![::xotcl::is $value mixin $arg]} {\n" +"::xotcl::Slot method type=hasmixin {name value arg} {\n" +"if {![::xotcl::is $value hasmixin $arg]} {\n" "error \"Value '$value' of $name has not mixin $arg\"}\n" "return $value}\n" "::xotcl::Slot method type=baseclass {name value} {\n" Index: generic/predefined.xotcl =================================================================== diff -u -r901ceb8f58714e31d28ed3277923fc69c085d252 -r464811a4aaa475de10e834b0a009521446163fc0 --- generic/predefined.xotcl (.../predefined.xotcl) (revision 901ceb8f58714e31d28ed3277923fc69c085d252) +++ generic/predefined.xotcl (.../predefined.xotcl) (revision 464811a4aaa475de10e834b0a009521446163fc0) @@ -853,13 +853,13 @@ # ::xotcl::is class # ::xotcl::is baseclass # ::xotcl::is metaclass - # ::xotcl::is mixin + # ::xotcl::is hasmixin # # Map these to type checkers. "object" and "class" # are already predefined, define the rest. - ::xotcl::Slot method type=mixin {name value arg} { - if {![::xotcl::is $value mixin $arg]} { + ::xotcl::Slot method type=hasmixin {name value arg} { + if {![::xotcl::is $value hasmixin $arg]} { error "Value '$value' of $name has not mixin $arg" } return $value Index: generic/tclAPI.h =================================================================== diff -u -r901ceb8f58714e31d28ed3277923fc69c085d252 -r464811a4aaa475de10e834b0a009521446163fc0 --- generic/tclAPI.h (.../tclAPI.h) (revision 901ceb8f58714e31d28ed3277923fc69c085d252) +++ generic/tclAPI.h (.../tclAPI.h) (revision 464811a4aaa475de10e834b0a009521446163fc0) @@ -68,13 +68,13 @@ static int convertToObjectkind(Tcl_Interp *interp, Tcl_Obj *objPtr, XOTclParam CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; - static CONST char *opts[] = {"type", "object", "class", "baseclass", "metaclass", "mixin", NULL}; + static CONST char *opts[] = {"type", "object", "class", "baseclass", "metaclass", "hasmixin", NULL}; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "objectkind", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; return result; } -enum ObjectkindIdx {ObjectkindNULL, ObjectkindTypeIdx, ObjectkindObjectIdx, ObjectkindClassIdx, ObjectkindBaseclassIdx, ObjectkindMetaclassIdx, ObjectkindMixinIdx}; +enum ObjectkindIdx {ObjectkindNULL, ObjectkindTypeIdx, ObjectkindObjectIdx, ObjectkindClassIdx, ObjectkindBaseclassIdx, ObjectkindMetaclassIdx, ObjectkindHasmixinIdx}; static int convertToMethodproperty(Tcl_Interp *interp, Tcl_Obj *objPtr, XOTclParam CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { Index: generic/xotcl.c =================================================================== diff -u -r901ceb8f58714e31d28ed3277923fc69c085d252 -r464811a4aaa475de10e834b0a009521446163fc0 --- generic/xotcl.c (.../xotcl.c) (revision 901ceb8f58714e31d28ed3277923fc69c085d252) +++ generic/xotcl.c (.../xotcl.c) (revision 464811a4aaa475de10e834b0a009521446163fc0) @@ -11341,7 +11341,7 @@ /* xotclCmd is XOTclIsCmd { {-argName "object" -required 1 -type tclobj} - {-argName "objectkind" -type "type|object|class|baseclass|metaclass|mixin"} + {-argName "objectkind" -type "type|object|class|baseclass|metaclass|hasmixin"} {-argName "value" -required 0 -type tclobj} } */ @@ -11382,8 +11382,8 @@ && IsBaseClass((XOTclClass*)object); break; - case ObjectkindMixinIdx: - if (value == NULL) return XOTclObjErrArgCnt(interp, NULL, NULL, " mixin "); + case ObjectkindHasmixinIdx: + if (value == NULL) return XOTclObjErrArgCnt(interp, NULL, NULL, " hasmixin "); success = (GetObjectFromObj(interp, obj, &object) == TCL_OK) && (GetClassFromObj(interp, value, &cl, 0) == TCL_OK) && hasMixin(interp, object, cl); Index: library/lib/xotcl1.xotcl =================================================================== diff -u -r901ceb8f58714e31d28ed3277923fc69c085d252 -r464811a4aaa475de10e834b0a009521446163fc0 --- library/lib/xotcl1.xotcl (.../xotcl1.xotcl) (revision 901ceb8f58714e31d28ed3277923fc69c085d252) +++ library/lib/xotcl1.xotcl (.../xotcl1.xotcl) (revision 464811a4aaa475de10e834b0a009521446163fc0) @@ -383,7 +383,7 @@ Object instproc isobject {{object:substdefault "[self]"}} {::xotcl::is $object object} Object instproc isclass {{class:substdefault "[self]"}} {::xotcl::is $class class} Object instproc ismetaclass {{class:substdefault "[self]"}} {::xotcl::is $class metaclass} - Object instproc ismixin {class} {::xotcl::is [self] mixin $class} + Object instproc ismixin {class} {::xotcl::is [self] hasmixin $class} Object instproc istype {class} {::xotcl::is [self] type $class} ::xotcl::alias Object contains ::xotcl::classes::xotcl2::Object::contains @@ -478,7 +478,7 @@ # support for XOTcl 1.* specific convenience routines Object instproc hasclass cl { - if {[::xotcl::is [self] mixin $cl]} {return 1} + if {[::xotcl::is [self] hasmixin $cl]} {return 1} ::xotcl::is [self] type $cl } Object instproc filtersearch {filter} { Index: tests/parameters.xotcl =================================================================== diff -u -r901ceb8f58714e31d28ed3277923fc69c085d252 -r464811a4aaa475de10e834b0a009521446163fc0 --- tests/parameters.xotcl (.../parameters.xotcl) (revision 901ceb8f58714e31d28ed3277923fc69c085d252) +++ tests/parameters.xotcl (.../parameters.xotcl) (revision 464811a4aaa475de10e834b0a009521446163fc0) @@ -506,15 +506,15 @@ C create c1 -mixin M Object create o -D method foo-base {x:baseclass} {return $x} -D method foo-class {x:class} {return $x} -D method foo-object {x:object} {return $x} -D method foo-meta {x:metaclass} {return $x} -D method foo-mixin {x:mixin,arg=::M} {return $x} -D method foo-type {x:object,type=::C} {return $x} +D method foo-base {x:baseclass} {return $x} +D method foo-class {x:class} {return $x} +D method foo-object {x:object} {return $x} +D method foo-meta {x:metaclass} {return $x} +D method foo-hasmixin {x:hasmixin,arg=::M} {return $x} +D method foo-type {x:object,type=::C} {return $x} ? {D info method parameter foo-base} "x:baseclass" -? {D info method parameter foo-mixin} "x:mixin,arg=::M" +? {D info method parameter foo-hasmixin} "x:hasmixin,arg=::M" ? {D info method parameter foo-type} "x:object,type=::C" ? {d1 foo-base ::xotcl2::Object} "::xotcl2::Object" @@ -535,8 +535,8 @@ "Value '::xotcl2::Object' of x is not a metaclass" \ "not a base class" -? {d1 foo-mixin c1} "c1" -? {d1 foo-mixin o} \ +? {d1 foo-hasmixin c1} "c1" +? {d1 foo-hasmixin o} \ "Value 'o' of x has not mixin ::M" \ "does not have mixin M" @@ -622,7 +622,7 @@ d:object,type=::C d1:object,type=C m:metaclass - mix:mixin,arg=M + mix:hasmixin,arg=M b:baseclass u:upper us:upper,multivalued @@ -642,7 +642,7 @@ ? {parameterFromSlot ParamTest c1} "c1:class,type=::MC,slot=::ParamTest::slot::c1" ? {parameterFromSlot ParamTest d} "d:object,type=::C,slot=::ParamTest::slot::d" ? {parameterFromSlot ParamTest d1} "d1:object,type=::C,slot=::ParamTest::slot::d1" -? {parameterFromSlot ParamTest mix} "mix:mixin,arg=M,slot=::ParamTest::slot::mix" +? {parameterFromSlot ParamTest mix} "mix:hasmixin,arg=M,slot=::ParamTest::slot::mix" ? {parameterFromSlot ParamTest x} "x:object,multivalued,slot=::ParamTest::slot::x o" ? {parameterFromSlot ParamTest u} "u:upper,slot=::ParamTest::slot::u" ? {parameterFromSlot ParamTest us} "us:upper,multivalued,slot=::ParamTest::slot::us" @@ -682,9 +682,8 @@ ? {ParamTest create p -us {A B}} ::p ? {p us add C end} "A B C" -# TODO: naming "type" and "mixin" not perfect. +# TODO: naming "type" not perfect. # maybe "type" => "hastype" -# maybe "mixin" => "hasmixin" # => effects as well ::xotcl::is # # TODO (optimization): optimizer can improve parameter checking: