[squeak-dev] String>expandMacros rules?

Levente Uzonyi leves at caesar.elte.hu
Mon Mar 6 02:35:55 UTC 2017


On Sun, 5 Mar 2017, tim Rowledge wrote:

>
>> On 05-03-2017, at 3:08 PM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
>> 
>> We already have #format:, which is why #expandMacros* is not being used at all.
>
> OK; then we should remove the redundant stuff some time.
>
>> I don't think we need a third implementation unless it provides
>> something the other two doesn’t.
>
> Oh, the printf stuff most definitely adds something; 
>
>       ‘%-0.1e’ printf: x
> is a whole lot nicer than
>      (x printShowingDecimalPlaces: 1) padded: #left to: 1 with: $0
>
> .. and having all the other options provided nice and cleanly is a real bonus. It’s well worth quickly loading to take a look at. I suspect quite a bit of code could be cleaned up by using this instead of assorted ad hoc methods.

Well, on the other hand it has considerable overhead, and probably 
inaccurate float printing.

Levente

>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Change is inevitable....except from vending machines.


More information about the Squeak-dev mailing list