On Wed, Oct 9, 2019 at 3:18 PM Sven Van Caekenberghe wrote:
>
> Actually, thinking about the original use case, I now feel that it would be
> best to remove #zipped/unzipped from String.
Please do. Cases like this teach us about the proper separation of concerns.
Regards,
--
Esteban
> On 4 Oct 2019, at 06:36, Richard O'Keefe wrote:
>
> There is no need for
> a separate #utf8Encoded, that's what asByteArrayDo: *does*."
so #asByteArrayDo: produces UTF8 bytes, which is an encoding, so it seems
fixed, IIUC.
But this is the Pharo mailing list and your are referring to a sys
examples, I think you will see
> >> why the chosen interface was used.
> >>
> >> Peter Kenny
> >>
> >>
> >> -Original Message-
> >> From: Pharo-users On Behalf Of
> >> Richard O'Keefe
> >> Sent: 03 October 2019 23:08
> >> To: Any question about pharo is welcome
> >> Subject: Re: [Pharo-users] How to zip a WideString
> >>
> >> The interface should surely be
> >> SomeClass
> >> methods for: 'compression'
> >> zipped "return a byte array"
> >>
> >>class methods for: 'decompression'
> >> unzip: aByteArray "return an instance of SomeClass"
> >>
> >>
> >
>
>
Actually, thinking about the original use case, I now feel that it would be
best to remove #zipped/unzipped from String.
The original problem was that
'Les élèves Françaises ont 100 €' zipped unzipped.
does not work (it fails on WideStrings), while we now have
'Les élèves Françaises ont 10
r Kenny
>>
>>
>> -----Original Message-
>> From: Pharo-users On Behalf Of Richard
>> O'Keefe
>> Sent: 03 October 2019 23:08
>> To: Any question about pharo is welcome
>> Subject: Re: [Pharo-users] How to zip a WideString
>>
>> The interface should surely be
>> SomeClass
>> methods for: 'compression'
>> zipped "return a byte array"
>>
>>class methods for: 'decompression'
>> unzip: aByteArray "return an instance of SomeClass"
>>
>>
>
ss in your examples, I think you will see why the chosen interface was
> used.
>
> Peter Kenny
>
>
> -Original Message-
> From: Pharo-users On Behalf Of Richard
> O'Keefe
> Sent: 03 October 2019 23:08
> To: Any question about pharo is welcome
> Subjec
hosen interface was
used.
Peter Kenny
-Original Message-
From: Pharo-users On Behalf Of Richard
O'Keefe
Sent: 03 October 2019 23:08
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] How to zip a WideString
The interface should surely be
SomeClass
m
The interface should surely be
SomeClass
methods for: 'compression'
zipped "return a byte array"
class methods for: 'decompression'
unzip: aByteArray "return an instance of SomeClass"
> On 3 Oct 2019, at 18:25, Sean P. DeNigris wrote:
>
> Peter Kenny wrote
>> Just 5 hours from when I raised the question, there is a solution in place
>> for everyone. This group is amazing!
>
> Indeed. Bravo, Sven and all of our other contributors.
Thanks, but I must say that it was Tomo's
Peter Kenny wrote
> Just 5 hours from when I raised the question, there is a solution in place
> for everyone. This group is amazing!
Indeed. Bravo, Sven and all of our other contributors.
I can't resist mentioning that the fix would almost certainly have taken
significantly longer a few years a
t;> Peter Kenny
>>
>> -Original Message-
>> From: Pharo-users On Behalf Of
>> Tomohiro Oda
>> Sent: 03 October 2019 12:22
>> To: Any question about pharo is welcome
>> Subject: Re: [Pharo-users] How to zip a WideString
>>
>> Sven,
>
t; -Original Message-
>> From: Pharo-users On Behalf Of
>> Tomohiro Oda
>> Sent: 03 October 2019 12:22
>> To: Any question about pharo is welcome
>> Subject: Re: [Pharo-users] How to zip a WideString
>>
>> Sven,
>>
>> Yes, ByteArr
n I was hoping for. Any
> chance this might make it into standard Pharo (perhaps inP8)?
>
> Peter Kenny
>
> -Original Message-
> From: Pharo-users On Behalf Of Tomohiro
> Oda
> Sent: 03 October 2019 12:22
> To: Any question about pharo is welcome
> Subject
s On Behalf Of Tomohiro
Oda
Sent: 03 October 2019 12:22
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] How to zip a WideString
Sven,
Yes, ByteArray>>zipped/unzipped are simple, neat and intuitive way of
zipping/unzipping binary data.
I also love the new idioms. They loo
Sven,
Yes, ByteArray>>zipped/unzipped are simple, neat and intuitive way of
zipping/unzipping binary data.
I also love the new idioms. They look clean and concise.
Best Regards,
---
tomo
2019年10月3日(木) 20:14 Sven Van Caekenberghe :
>
> Actually, thinking about this a bit more, why not add #zipped
Actually, thinking about this a bit more, why not add #zipped #unzipped to
ByteArray ?
ByteArray>>#zipped
"Return a GZIP compressed version of the receiver as a ByteArray"
^ ByteArray streamContents: [ :out |
(GZipWriteStream on: out) nextPutAll: self; close ]
ByteArray>>#unzipped
Hi Tomo,
Indeed, I stand corrected, it does indeed seem possible to use the existing
gzip classes to work from bytes to bytes, this works fine:
data := ByteArray streamContents: [ :out | (GZipWriteStream on: out)
nextPutAll: 'foo 10 €' utf8Encoded; close ].
(GZipReadStream on: data) upToEnd ut
n
Caekenberghe
Sent: 03 October 2019 10:56
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] How to zip a WideString
Hi Peter,
About #zipped / #unzipped and the inflate / deflate classes: your observation
is correct, these work from string to string, while clearly the compressed
Peter and Sven,
zip API from string to string works fine except that aWideString
zipped generates malformed zip string.
I think it might be a good guidance to define
String>>zippedWithEncoding: and ByteArray>>unzippedWithEncoding: .
Such as
String>>zippedWithEncoding: encoder
zippedWithEncoding: e
Hi Peter,
About #zipped / #unzipped and the inflate / deflate classes: your observation
is correct, these work from string to string, while clearly the compressed
representation should be binary.
The contents (input, what is inside the compressed data) can be anything, it is
not necessarily a
Hello
I have a problem with text storage, to which I seem to have found a
solution, but it's a bit clumsy-looking. I would be grateful for
confirmation that (a) there is no neater solution, (b) I can rely on this to
work - I only know that it works in a few test cases.
I need to store a lar
21 matches
Mail list logo