On 27 Feb 2013, at 11:19, Martin Dias <[email protected]> wrote:

> Hi
> 
> I discovered this protocol in String hierarchy. Are you familiar with it?
> 
> The method comment of #fromPacked: is:
> "Convert from a longinteger to a String of length 4."
> 
> The only sender in Pharo 2.0 is MethodFinder. For WideString, it does not 
> work.
> 
> In examples:
> 
> ByteString fromPacked: 'text' asPacked. ---> 'text'
> ByteString fromPacked: 'martin' asPacked. ---> 'rtin'
> WideString fromPacked: ('text' asWideString asPacked). ---> error
> 
> 
> 
> WideString>>asPacked can be easily fixed adding an explicit return to
> the calculation (it's now implicitly returning self).
> 
> But... it only encodes one letter:
> 
> WideString fromPacked: 'martin' asWideString asPacked ---> 'n'
> 
> 
> I checked that in Squeak 4.3 there are not senders too.
> 
> So... Should we fix the WideString implementation, or directly remove
> this protocol?
> 
> Martin

It might have something to do with pre Mac OS X days, Mac creator/type codes.

Unless this follows some open standard with a spec, I would say nuke it.

Doing something like this without specifying encoding strikes me as dangerous.

Sven

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill


Reply via email to