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

Philippe Marschall philippe.marschall at gmail.com
Thu Nov 1 20:17:02 UTC 2007


2007/11/1, Esteban A. Maringolo <emaringolo at gmail.com>:
> 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?

Besides when you explicitly render ByteArrays or put ByteArrays in
places where 'any kind of object will do' I'm aware of:

WAEncoderTest >> #testEncodedUtf8Url
WAFileLibrary >> #compileText: aByteArrayOrString selector:

Those certainly could be fixed.

Cheers
Philippe

> Best regards,
>
> --
> Esteban A. Maringolo
> eMaringolo at gmail.com
> _______________________________________________
> seaside-dev mailing list
> seaside-dev at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>


More information about the seaside-dev mailing list