Skip to content
Tcl Source Code View Ticket
Login

View Ticket

"string is double" shimmers object, while returning 0

Closed / Fixed1382287fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2005-12-16 09:30:16
Since a4 a new string to number conversion technique
has been introduced. This new behaviour, in current
state,  can lead to severe program failures.

The question is, can it be considered valid for "string
is double" to return 0 (false) while shimmering the
Tcl_Obj in question to "double"?


The attached TCL snippet illustrates the problem.
msoferplain2005-12-16 16:35:01
Logged In: YES 
user_id=148712

No file is attached.
thipplerplain2005-12-16 16:39:42
File Added - 160060: a4numbers_bug.tcl
dkf Pending ticket [1382287fff]. [History diff]2005-12-16 20:03:01
dkf Ticket [1382287fff]: 2 changes [History diff]2005-12-16 20:03:02
dgp Open ticket [1382287fff]. [History diff]2005-12-17 00:03:36
dgpplain2005-12-17 00:03:37
Logged In: YES 
user_id=80530

Thanks for catching this.
dgpplain2005-12-17 00:11:33
Logged In: YES 
user_id=80530

% set x 2turtledoves
2turtledoves
% string is double $x
0
% string is double $x
1
dgpplain2005-12-17 03:12:44
Logged In: YES 
user_id=80530


This is related to 1360532.

Both bugs arise because the
[string is] implementation
does its own scan checking
for trailing whitespace after
TclParseNumber returns.

The "right" solution may still
involve more revisions to the
TclParseNumber() interface.
dgpplain2005-12-20 01:14:56
Logged In: YES 
user_id=80530


here's a patch that fixes
1382287 and 1360532.

still needs some test cases.
dgpplain2005-12-20 01:14:57
File Added - 160402: 1382287.patch
dgpplain2005-12-20 01:39:41
File Added - 160407: 1382287.patch

Logged In: YES 
user_id=80530


updated patch includes
tests.  committing now, but
leaving assigned to kennykb
in case he wants further
review when back at work.
dgpplain2005-12-20 01:39:42
File Deleted - 160402:
sf-robotplain2006-01-14 10:20:47
Logged In: YES 
user_id=1312539

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
Log in (anonymous is fine) to add a comment.

Attachments: