|
From: <dg...@us...> - 2008-12-08 16:40:16
|
This one, alas, is not trouble free. There are subtleties to this, which give me enough fear to not want to rush it. As an example, the addition of %#b as a format specifier for [format] as in the TIP example: format %#06b 5 => 0b0101 ...introduces something completely new. For this format specifier the %# means "use Tcl's prefix for indicating base-2 formatting" -- in this case the 0b. But then we look at: % format %#o 14 016 (NOT 0o16 !) This is what the %#o format specifier has always done, and for consistency, ought to keep doing (consider the Tcl scripts using [format] to write C code), but is not following the same principles as %#b, generating the deprecated format instead of the preferred one. Similar troubles arise on the [scan] side, as pointed out in Bug 2373594: % scan 0b111 %i 0 % scan 0o7 %i 0 Perhaps surprising, but consistent with the non-error operations of [format] and [scan] since time began, and since I know not all the strange and wonderful uses these tools find, I fear changing them incompatibly. For better or worse, [format] and [scan] have always been just emulations of sprintf() and sscanf() lifted to script level. When we venture to extend beyond that, I'd prefer something done with more time to examine the implications with care and completeness (see TIP 297). I vote: NO but please understand that really means NOT NOW. Raise it again for the next cycle. DGP |