Mantis - Squeak
Viewing Issue Advanced Details
6697 Kernel minor N/A 09-25-07 00:25 04-18-10 22:04
nicolas cellier  
andreas  
normal  
closed 3.10  
fixed  
none    
none trunk  
0006697: Number>>storeOn:base: default implementation is wrong
It calls printOn:base:
But modern definition of printOn:base: don't print the radix prefix.
While storeOn:base: should.

This is one cause of http://bugs.squeak.org/view.php?id=6695 [^]

Since the storeOn:base: method is defined in every subclass where relevant
(except ScaledDecimal see http://bugs.squeak.org/view.php?id=6696), [^] I strongly suggest to implement self subclassResponsibility in Number like printOn:base:

Don't expect a test case for this bug. It is quite trivial and virtual, because it is in an abstract class and it is overriden in subclasses. But it is a bug. To show it, one need to define a new Number class defining just printOn:base: but not storeOn:base: SUPER-HEAVY-NONSENSE
related to 0006695closed andreas Float storeStringBase: does not store the radix 
related to 0006696assigned andreas ScaledDecimal can read in base 16 but cannot print in base 16 
 NumberStoreOnBase-M6697-Patch.1.cs [^] (617 bytes) 09-25-07 00:30

Notes
(0011197)
nicolas cellier   
09-25-07 00:31   
The patch also add a comment to printOn:base:
(0011199)
nicolas cellier   
09-25-07 00:57   
In 3.8 the code was correct because printOn:base: USED TO print the radix prefix

Who ever made the change SHOULD have taken care of all implementors and senders.

Was it a good decision anyway?
Standard compliant?
Has it been discussed in squeak-dev or somewhere?

(0011567)
Keith_Hodges   
12-17-07 17:26   
"fix begin"
Installer mantis bug: 6697 fix:'NumberStoreOnBase-M6697-Patch.1.cs'.
"fix end"

(0013330)
nicolas cellier   
10-04-09 17:56   
Fixed in
http://source.squeak.org/trunk/Kernel-nice.255.mcz [^]