Skip to content
Tcl Source Code View Ticket
Login

View Ticket

inconsistent error message from compiled [if] command

Closed / Fixed711371ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2003-03-28 14:56:04
% if {42-22} ;# stuff
wrong # args: no script following "{42-22} ;# stuff
" argument

% set x if
if
% $x {42-22} ;# stuff
wrong # args: no script following "42-22" argument


OK. I admit this is *so* low priority ;)

It is a little surprising that the compiled [if]
can 'see' the curly braces and comment because
conceptually at least all it should see is a single
string "42-22".
dgpplain2003-03-28 23:06:58
Logged In: YES 
user_id=80530


In what release(s) of Tcl do you
see this behavior?  Please try
as many as you have available.
msoferplain2003-03-28 23:19:13
Logged In: YES 
user_id=148712

Bug present in 8.3.4 and all 8.4.x release(s)
dkf Ticket [711371ffff]: 1 change [History diff]2003-03-28 23:19:42
dgpplain2003-03-28 23:22:36
Logged In: YES 
user_id=80530

thanks.  Sometimes little details like this
can be a canary in the coal mine, but this
one goes back to 8.3.4, so probably just
a tiny annoyance.
nobodyplain2003-04-07 17:05:50
Logged In: NO 

Get the same problem with just [if]:

% info patchlevel
8.4.2
% if ;# stuff
wrong # args: no expression after "if ;# stuff
" argument
% set X if
if
% $X ;# if
wrong # args: no expression after "if" argument
dgpplain2003-04-08 01:02:48
Logged In: YES 
user_id=80530

This bug is due to literal lengths
in sprintf() calls in TclCompieIfCmd.
dgpplain2003-04-08 03:19:21
Logged In: YES 
user_id=80530


fixed for 8.4.3+
Log in (anonymous is fine) to add a comment.