Index: generic/gentclAPI.decls =================================================================== diff -u -r666f7ad2cb2562f3d62fc9aea54efb9b0826f6b0 -r73e2bbd4ee9e0acbe38dd7bb634a9ad11e7b3bf5 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 666f7ad2cb2562f3d62fc9aea54efb9b0826f6b0) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision 73e2bbd4ee9e0acbe38dd7bb634a9ad11e7b3bf5) @@ -17,8 +17,8 @@ # XOTcl commands # xotclCmd alias XOTclAliasCmd { - {-argName "object" -required 1 -type object} - {-argName "methodName" -required 1} + {-argName "object" -type object} + {-argName "methodName"} {-argName "-objscope"} {-argName "-per-object"} {-argName "-protected"} Index: generic/predefined.h =================================================================== diff -u -r666f7ad2cb2562f3d62fc9aea54efb9b0826f6b0 -r73e2bbd4ee9e0acbe38dd7bb634a9ad11e7b3bf5 --- generic/predefined.h (.../predefined.h) (revision 666f7ad2cb2562f3d62fc9aea54efb9b0826f6b0) +++ generic/predefined.h (.../predefined.h) (revision 73e2bbd4ee9e0acbe38dd7bb634a9ad11e7b3bf5) @@ -22,8 +22,13 @@ "Object method defaultmethod {} {::xotcl::self}\n" "Object method objectparameter {} {;}\n" "Class method -per-object __unknown {name} {}\n" -"Object method alias {-per-object:switch methodName cmd} {\n" -"::xotcl::alias [self] $methodName {*}[expr {${per-object} ? \"-per-object\" : \"\"}] $cmd}\n" +"::xotcl::alias Object $cmd -objscope ::$cmd\n" +"Object method alias {-objscope:switch -per-object:switch -protected:switch methodName cmd} {\n" +"::xotcl::alias [self] $methodName \\\n" +"{*}[expr {${objscope} ? \"-objscope\" : \"\"}] \\\n" +"{*}[expr {${per-object} ? \"-per-object\" : \"\"}] \\\n" +"{*}[expr {${protected} ? \"-protected\" : \"\"}] \\\n" +"$cmd}\n" "Object create ::xotcl2::objectInfo\n" "Object create ::xotcl2::classInfo\n" "::xotcl::dispatch objectInfo -objscope ::eval {\n" Index: generic/predefined.xotcl =================================================================== diff -u -r666f7ad2cb2562f3d62fc9aea54efb9b0826f6b0 -r73e2bbd4ee9e0acbe38dd7bb634a9ad11e7b3bf5 --- generic/predefined.xotcl (.../predefined.xotcl) (revision 666f7ad2cb2562f3d62fc9aea54efb9b0826f6b0) +++ generic/predefined.xotcl (.../predefined.xotcl) (revision 73e2bbd4ee9e0acbe38dd7bb634a9ad11e7b3bf5) @@ -65,11 +65,23 @@ # Add an alias method. cmdName for XOTcl method can be added via # [... info method name ] - Object method alias {-per-object:switch methodName cmd} { - ::xotcl::alias [self] $methodName {*}[expr {${per-object} ? "-per-object" : ""}] $cmd - } + ::xotcl::alias Object $cmd -objscope ::$cmd + Object method alias {-objscope:switch -protected:switch methodName cmd} { + ::xotcl::alias [self] $methodName \ + {*}[expr {${objscope} ? "-objscope" : ""}] \ + {*}[expr {${protected} ? "-protected" : ""}] \ + $cmd + + Class method alias {-objscope:switch -per-object:switch -protected:switch methodName cmd} { + ::xotcl::alias [self] $methodName \ + {*}[expr {${objscope} ? "-objscope" : ""}] \ + {*}[expr {${per-object} ? "-per-object" : ""}] \ + {*}[expr {${protected} ? "-protected" : ""}] \ + $cmd + } + ######################## # Info definition ######################## Index: generic/tclAPI.h =================================================================== diff -u -r666f7ad2cb2562f3d62fc9aea54efb9b0826f6b0 -r73e2bbd4ee9e0acbe38dd7bb634a9ad11e7b3bf5 --- generic/tclAPI.h (.../tclAPI.h) (revision 666f7ad2cb2562f3d62fc9aea54efb9b0826f6b0) +++ generic/tclAPI.h (.../tclAPI.h) (revision 73e2bbd4ee9e0acbe38dd7bb634a9ad11e7b3bf5) @@ -2545,8 +2545,8 @@ {"varname", 1, 0, convertToString}} }, {"::xotcl::alias", XOTclAliasCmdStub, 6, { - {"object", 1, 0, convertToObject}, - {"methodName", 1, 0, convertToString}, + {"object", 0, 0, convertToObject}, + {"methodName", 0, 0, convertToString}, {"-objscope", 0, 0, convertToString}, {"-per-object", 0, 0, convertToString}, {"-protected", 0, 0, convertToString},