Skip to content
Tcl Source Code View Ticket
Login

View Ticket

scan manual page error in %i description

Closed / Fixed9e91ffe236b74a8d2d53759aa62821f37de7b2b5Created 12 years agoUpdated 42 days ago
Descriptionplain2015-04-28 17:02:44
The scan manual has the following text for the i conversion character:

"The base (i.e. decimal, binary, octal, or hexadecimal) is determined in the same fashion as described in expr."

But, scan does not actually work this way.

e.g.
# These commands works as advertised
scan 0xFF %i
scan 0100 %i

# These commands always produce 0 as the result
scan 0o100 %i
scan 0b0111 %i
dkfwiki2015-05-16 05:55:59

The %i conversion appears to have been forgotten when we extended the parsing of numbers in Tcl expressions.

dgpplain2015-05-20 11:24:27
It wasn't forgotten.  I was intentionally left compatible.

( TCL_PARSE_SCAN_PREFIXES is not forgetting.  :) )

What was forgotten was that the documentation shorthand "like expr"
became false and wasn't corrected.
serhiy.storchakawiki2026-10-14 18:38:50

Fixed by [8a99d79f7e] in 8.6.7: the manual page now says that the base is determined by the C convention (leading 0 for octal, prefix 0x for hexadecimal).

serhiy.storchaka Ticket [9e91ffe236]: 3 changes [History diff]2026-10-22 17:19:25
Log in (anonymous is fine) to add a comment.