[Seaside-dev] WAPlatformTest>>#testAsString against convention

Esteban A. Maringolo emaringolo at gmail.com
Thu Nov 1 13:06:21 UTC 2007


Hi Philippe,

On 10/31/07, Philippe Marschall <philippe.marschall at gmail.com> wrote:
> 2007/10/31, Esteban A. Maringolo <emaringolo at gmail.com>:
> > In the coding conventions in
> > <http://www.seaside.st/community/conventions> it mentions the
> > avoidance of #asString.  However, WAPlatformTest>>#testAsString uses
> > it for testing.
> > Should I omit this test?

> The conventions are outdated.

:-/

> You have to use #asString for converting Symbols to Strings.

Yes, for conversion #as* should be used.

> For the rest don't even get me started.

This is always an arguable topic.

> We'll change this, we'll introduce our own String conversion method :-/

Great.

I found another difference, ByteArray>>#displayString in Squeak answer
aString with characters from its elements.
In Dolphin displayString displays the ByteArray in its own
displayString format (printString) which for
#(97 99 99) asByteArray displayString "displayIt" #[97 98 99]

because Dolphin has a special syntax for byte arrays, which is  #[].

But...
#(97 98 99) asByteArray asString -> 'abc' "displayIt"

Semantically speaking, for conversion (which is the case), IMO
#asString is the proper message.

Is #displayString widely used to convert ByteArrays to strings in Seaside?


Best regards,

-- 
Esteban A. Maringolo
eMaringolo at gmail.com


More information about the seaside-dev mailing list