Mantis - Squeak
Viewing Issue Advanced Details
4996 Kernel minor always 09-18-06 21:55 09-19-09 22:26
Hans-Martin  
 
normal  
feedback 3.8  
open  
none    
none  
0004996: printStringRadix: includes the radix only if decimal
The interaction between printStringRadix: (which adds the 10r for decimal numbers only) and printStringBase: which does not add a radix designator at all) leads to pretty inconsistent behavior:

(100 printStringRadix: 10) = '10r100'
(100 printStringRadix: 16) = '64'

ANSI is a bit difficult to read regarding the expected behavior of printStringRadix:, but I understand it as stating that the output is expected to be in the format which would be used after a radix specifier:
> The sequence of characters must be recognizable using the
> radixDigits production of the Smalltalk Lexical Grammar as if
> the numeric value of the radixSpecifier was base.

So the current printStringBase: behaves exactly as ANSI printStringRadix: should do.
related to 0006695closed andreas Float storeStringBase: does not store the radix 

Notes
(0011193)
nicolas cellier   
09-24-07 23:10   
Appear to be fixed in 3.10
(0013319)
nicolas cellier   
09-19-09 22:26   
To obtain '16r64'

Squeak: 100 printStringRadix: 16 ; storeStringRadix: 16.
gst: 100 printStringRadix: 16.
Dolphin6: 100 printStringRadix: 16.
VW76: 100 storeStringRadix: 16.

To obtain '64'

Squeak: 100 printStringBase: 16.
gst: 100 printString: 16.
Dolphin6: 100 printStringRadix: 16 showRadix: false.
VW76: 100 printStringRadix: 16 ; printStringBase: 16.

VW behaves differently, maybe they are right if you understood ANSI phrasing correctly, I just can't.

Since Squeak trunk now has a consistent behaviour with bases 10 and 16,
and since the majority of dialect seems Squeak compatible (except VW),
could we close the issue ?