[GemStone-Smalltalk] #printString [was Re: first: / last:]
via GemStone-Smalltalk
gemstone-smalltalk at lists.gemtalksystems.com
Fri Sep 19 12:42:27 PDT 2014
>Actually, I would argue against this. You want a #printAsLiteral or>something like that, implemented in all your dialects. In such a case, you
>take responsibility for ensuring the array can be represented literally.
True... and that's what do: we use our own string output methods.
But for printing an Array I think that #(1 2 3) is a more readable output than anArray( 1, 2, 3).
Bob
On Friday, September 19, 2014 11:33 AM, Richard Sargent via GemStone-Smalltalk <gemstone-smalltalk at lists.gemtalksystems.com> wrote:
Gemstone/S mailing list wrote
> I can understand the need to keep backward compatibility with base
> methods, but what about printString on Array?
> Any chance it could be made to work like the VW & Pharo?
>
> GS: #(a b c) printString --> anArray( #'a', #'b', #'c') ... #(1 2 3)
> printString --> anArray( 1, 2, 3)
> VW & Pharo: #(a b c) printString --> #(#a #b #c) ... #(1 2 3)
> printString --> #(1 2 3)
>
>
> With VW & Pharo you can evaluate the result and get an Array again. Handy
> when building scripts.
>
> I use our own version of #displayString to get the string we need.
>
> I'd use storeString, but in my case I'm going across dialects (GS <> VW),
> and on GS it's a bit verbose...
> #(1 2 3) storeString --> (PassiveObject newWithContents: '^610^Array(3
> ""1 2 3 ') activate
>
> FWIW: VA is not good either... #(a b c) --> (#a #b #c) ... #(1 2 3) -->
> (1 2 3)
Actually, I would argue against this. You want a #printAsLiteral or
something like that, implemented in all your dialects. In such a case, you
take responsibility for ensuring the array can be represented literally.
--
View this message in context: http://forum.world.st/first-last-tp4778749p4779008.html
Sent from the Gemstone/S mailing list archive at Nabble.com.
_______________________________________________
GemStone-Smalltalk mailing list
GemStone-Smalltalk at lists.gemtalksystems.com
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/gemstone-smalltalk/attachments/20140919/5fe101e7/attachment.html>
More information about the GemStone-Smalltalk
mailing list