Overview
| Artifact ID: | df6fb1eff986e143f09760f0663eeb7c78f6191615a430edc5ebbdb6d4057f64 |
|---|---|
| Ticket: | b204c13b2b2335a6baf8fa1a3c6a627432380012
Incompatibility between 8.6 and 8.7 with underscores in numerics |
| User & Date: | apnadkarni on 2023-08-27 17:16:35 |
Changes
- icomment:
I understand the TIP is approved and do not have the energy to pursue another TIP to limit this change to 9.0. Nevertheless, I'll just say imo this clouds the Tcl's definition of compatibility. On a separate note, to elaborate / second Julian's comments, * every language I know that uses underscores as digit separators **only in integer literals**. There is a clear distinction between `12_3` and `"12_3"` and underscores are ignored only in the former. * Moreover, any underscores present in values stored in variables and operations on them are not subject to this. For better or worse, Tcl makes no such distinction between integer and string literals and since the discarding happens not at the source lexing level but within commands that use the number parsing functions, the change is ubiquitous and the effects more widespread. I'll admit I had not realized the distinction when reading the TIP, perhaps because it also completely focuses on the use of underscores within source code with no reference to their treatment by commands. For example, ``` % string is entier -strict 2_0_0 1 % expr 2_0_0 200 % scan 2_0_0 %d 2 ``` I presume the behaviour above where `scan` does not treat underscore specially like `expr` and `string is entier` is intentional but it is inconsistent and confusing. In any case, probably water under the bridge and not something I'm going to pursue at this point. /Ashok
- login: "apnadkarni"
- mimetype: "text/x-markdown"