Skip to content
Tcl Source Code View Ticket
Login

View Ticket

variable has to have at least one arg

Closed / Fixed426038ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 25 years ago
Descriptionplain2001-05-21 20:13:15
@ashland [~] $ tclsh
tclsh8.3 [~]variable 
tclsh8.3 [~]

It should produce an error:
% variable
wrong # args: should be "variable ?name value...? name
?value?"
davidwplain2001-05-22 03:13:16
File Added - 6517: /home/davidw/tcl.diff
dkf Ticket [426038ffff]: 1 change [History diff]2001-05-22 17:08:41
hobbsplain2001-07-04 04:09:51
Logged In: YES 
user_id=72656

Strictly speaking, the command is defined to accept no 
arguments and do nothing.  I don't know what the value of 
that is, but changing it might effect someone that was 
doing something silly like:
   eval variable $args
dgpplain2001-07-04 07:37:19
Logged In: YES 
user_id=80530

I disagree, Jeff.  Looking carefully at the SYNOPSIS
of the [variable] man page:

 variable ?name value...? name ?value?

it is indicated that [variable] needs at least one "name"
argument.  [variable] is acting contrary to that
documentation, so there *is* a bug.

My opinion: anyone counting on no arguments to [variable]
working is relying on undocumented behavior and deserves
whatever incompatibility they suffer.

But, I'd accept an update to the docs to match the
behavior as well.
hobbsplain2001-07-04 07:51:52
Logged In: YES 
user_id=72656

Doh, David and Don are correct.  I was led astray by seeing 
the first arg as a '?', not noting the later 
required 'name' (weird).  I've added the patch to 8.4a3 
with tests (nothing was expecting the no args in the test 
suite).
Log in (anonymous is fine) to add a comment.

Attachments: