summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--doc/variable.n6
-rw-r--r--generic/tclVar.c7
-rw-r--r--tests/var.test14
4 files changed, 13 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 4db062d..86b9324 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
TIP #323 IMPLEMENTATION (partial)
* doc/global.n: Revise [global] to accept zero variable names.
+ * doc/variable.n: Revise [variable] likewise.
* generic/tclVar.c:
* tests/proc-old.test:
* tests/var.test:
diff --git a/doc/variable.n b/doc/variable.n
index fa99930..6e5b5c4 100644
--- a/doc/variable.n
+++ b/doc/variable.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: variable.n,v 1.8 2005/05/10 18:34:04 kennykb Exp $
+'\" RCS: @(#) $Id: variable.n,v 1.9 2008/09/25 19:51:28 dgp Exp $
'\"
.so man.macros
.TH variable n 8.0 Tcl "Tcl Built-In Commands"
@@ -14,7 +14,9 @@
.SH NAME
variable \- create and initialize a namespace variable
.SH SYNOPSIS
-\fBvariable \fR?\fIname value...\fR? \fIname \fR?\fIvalue\fR?
+\fBvariable \fIname
+.sp
+\fBvariable \fR?\fIname value...\fR?
.BE
.SH DESCRIPTION
diff --git a/generic/tclVar.c b/generic/tclVar.c
index e609c70..15b1856 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclVar.c,v 1.167 2008/09/25 19:26:38 dgp Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.168 2008/09/25 19:51:29 dgp Exp $
*/
#include "tclInt.h"
@@ -3938,11 +3938,6 @@ Tcl_VariableObjCmd(
int i, result;
Tcl_Obj *varNamePtr, *tailPtr;
- if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "?name value ...? name ?value?");
- return TCL_ERROR;
- }
-
for (i=1 ; i<objc ; i+=2) {
/*
* Look up each variable in the current namespace context, creating it
diff --git a/tests/var.test b/tests/var.test
index c160cbd..698cd20 100644
--- a/tests/var.test
+++ b/tests/var.test
@@ -14,7 +14,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: var.test,v 1.33 2008/09/25 19:26:40 dgp Exp $
+# RCS: @(#) $Id: var.test,v 1.34 2008/09/25 19:51:29 dgp Exp $
#
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -510,14 +510,14 @@ test var-7.15 {Tcl_VariableObjCmd, array element parameter} {
} res
set res
} "can't define \"arrayvar(1)\": name refers to an element in an array"
-test var-7.16 {Tcl_VariableObjCmd, no args} {
- list [catch {variable} msg] $msg
-} {1 {wrong # args: should be "variable ?name value ...? name ?value?"}}
-test var-7.17 {Tcl_VariableObjCmd, no args} {
+test var-7.16 {Tcl_VariableObjCmd, no args (TIP 323)} {
+ variable
+} {}
+test var-7.17 {Tcl_VariableObjCmd, no args (TIP 323)} {
namespace eval test_ns_var {
- list [catch {variable} msg] $msg
+ variable
}
-} {1 {wrong # args: should be "variable ?name value ...? name ?value?"}}
+} {}
test var-8.1 {TclDeleteVars, "unset" traces are called with fully-qualified var names} {
catch {namespace delete test_ns_var}