[squeak-dev] anyone rely on this?

Frank Shearar frank.shearar at gmail.com
Thu Jul 3 11:07:52 UTC 2014


On 3 July 2014 11:58, Bert Freudenberg <bert at freudenbergs.de> wrote:
> On 03.07.2014, at 03:54, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>
> On Wed, Jul 2, 2014 at 5:26 PM, Nicolas Cellier
> <nicolas.cellier.aka.nice at gmail.com> wrote:
>>
>>
>> 2014-07-03 1:59 GMT+02:00 Chris Muller <asqueaker at gmail.com>:
>>
>>> On Wed, Jul 2, 2014 at 2:47 PM, Eliot Miranda <eliot.miranda at gmail.com>
>>> wrote:
>>>>
>>>> Hi All,
>>>>
>>>>
>>>> (32 to: 127) asByteArray asString do: [:c| c class] =>  '
>>>> !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
>>>> '
>>>>
>>>> so far so good.
>>>>
>>>>
>>>> (32 to: 127) asWordArray asString do: [:c| c class] => 'a WordArray(32
>>>> 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
>>>> 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
>>>> 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
>>>> 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
>>>> 125 126 127)'
>>>>
>>>> ?!?!?!
>>>>
>>>> Surely this should be a String of some sort also?  Any objections if I
>>>> implement this as such?
>>>>
>>>
>>> Are you saying you want to override asString in WordArray so you get a
>>> string-representation of the WordArray instead of its printString?  I wasn't
>>> sure whether the do: part of those code snippets fits into your question and
>>> if I missed something..
>
>
> I'm sure Eliot meant to ignore the "do:" part. It's only about #asString.
>
> Eliot: a more descriptive subject would have been nice ;)
>
>> Yes, but which string?
>> Maybe you wan't to turn the WordArray into a WideString ?
>
>
> This is useful, and symmetrical with ByteArray>>asString..
>
>
> Yep. We should also have String>>asWordArray.
>
> We want
>
> aString asWordArray asString = aString
>
> just like
>
> aByteString asByteArray asString = aByteString
>
> And while we're on that topic, this is just wrong:
>
> 'foo' asWideString asByteArray
> => #[0 0 0 102 0 0 0 111 0 0 0 111]

Why is that wrong? Because #asByteArray doesn't make sense without
specifying an encoding?

frank

> in particular since
>
> #(1 2 3) asWordArray asByteArray
> =>  #[1 2 3]
>
> - Bert -
>
>
>
>
>


More information about the Squeak-dev mailing list