[ENH] IntegerPrintOnPadding

stéphane ducasse ducasse at iam.unibe.ch
Tue Mar 30 09:14:42 UTC 2004


I will have a look at that. :)



On 29 mars 04, at 19:47, Alexander at Lazarevic.de wrote:

> Hi Stef!
>
> This might have edges, but maybe starting point.
>
> Alex
>
>> So what do you prefer? I like the idea of alexander. Alexander do you
>> want to do it? I can review it that way. Now I'm the middle of an
>> export/import facility for ThreadNavigator so that I stop to lose 
>> time for building demoes.
>
> from preamble:
>
> "Change Set:		IntegerPrintOnPadding
> Date:			29 March 2004
> Author:			Alexander Lazarevic
>
> This changeset improves and changes (a little) the way integers can be
> printend in different numeratives.
>
> * The meaning of printStringBase has changed. printStringBase: will 
> just
> print
> a number in any base and the (new) storeStringBase: will print the
> number with a leading base.
>
> Examples:
>
> 3994 printStringBase: 16	-->	'F9A'
> 3994 storeStringBase: 16	-->	'16rF9A'
>
> * The new method printOn:base:length:padded: (et al) helps formatting
> output a little.
>
> Examples:
>
> 3735928559 printStringBase: 16 length: 20 padded: false	-->	'
> DEADBEEF'
> 3735928559 printStringBase: 16 length: 20 padded: true	-->
> '000000000000DEADBEEF'
> 3735928559 storeStringBase: 16 length: 20 padded: true	-->
> '16r000000000DEADBEEF'
> -3735928559 storeStringBase: 16 length: 20 padded: false	-->	'
> -16rDEADBEEF'
>
> * Some redundant code got removed, some methods got deprecated and some
> moved.As one
> result Fractions now can also respond to printOn:base: like Integers 
> and
> Floats (just to be consistent).
>
> Examples:
> (15/11) printStringBase: 16	-->	'(F/B)'
> (15/11) storeStringBase: 16	-->	'(16rF/16rB)'
> 		
> The following worked before:
> (16rF/16rB) printString	-->	'(15/11)'
>
> * For more examples see the IntegerPrintOnPaddingTests changeset and 
> the
> classes IntegerTests and
> FrationTests
> "!
> <IntegerPrintOnPadding.cs.gz>




More information about the Squeak-dev mailing list