diff options
-rw-r--r-- | generic/tclOOScript.h | 4 | ||||
-rw-r--r-- | tools/tclOOScript.tcl | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclOOScript.h b/generic/tclOOScript.h index a1e4624..f2e99b0 100644 --- a/generic/tclOOScript.h +++ b/generic/tclOOScript.h @@ -116,7 +116,7 @@ static const char *tclOOSetupScript = "\t\t\t\t}]\n" "\t\t}\n" "\t}\n" -"\tproc define::classmethod {name {args {}} {body {}}} {\n" +"\tproc define::classmethod {name args} {\n" "\t\t::set argc [::llength [::info level 0]]\n" "\t\t::if {$argc == 3} {\n" "\t\t\t::return -code error -errorcode {TCL WRONGARGS} [::format \\\n" @@ -125,7 +125,7 @@ static const char *tclOOSetupScript = "\t\t}\n" "\t\t::set cls [::uplevel 1 self]\n" "\t\t::if {$argc == 4} {\n" -"\t\t\t::oo::define [::oo::DelegateName $cls] method $name $args $body\n" +"\t\t\t::oo::define [::oo::DelegateName $cls] method $name {*}$args\n" "\t\t}\n" "\t\t::tailcall forward $name myclass $name\n" "\t}\n" diff --git a/tools/tclOOScript.tcl b/tools/tclOOScript.tcl index 10d3bf8..941f15c 100644 --- a/tools/tclOOScript.tcl +++ b/tools/tclOOScript.tcl @@ -195,7 +195,7 @@ # # ---------------------------------------------------------------------- - proc define::classmethod {name {args {}} {body {}}} { + proc define::classmethod {name args} { # Create the method on the class if the caller gave arguments and body ::set argc [::llength [::info level 0]] ::if {$argc == 3} { @@ -205,7 +205,7 @@ } ::set cls [::uplevel 1 self] ::if {$argc == 4} { - ::oo::define [::oo::DelegateName $cls] method $name $args $body + ::oo::define [::oo::DelegateName $cls] method $name {*}$args } # Make the connection by forwarding ::tailcall forward $name myclass $name |