Not just more readable. They can also be more efficient. Look at
#select:thenCollect: in OrderedCollection:
select: selectBlock thenCollect: collectBlock
" Optimized version Collection>>#select:thenCollect: "
| newCollection element |
newCollection := self copyEmpty.
firstIn
You are correct Peter - I jumped the gun, as it was #select:thenDo: where I hit
the problem - and yes it doesn’t make sense to answer a result from Do.
I do kind of miss the concept of: #select:thenDo:ifNone: as well as
#select:thenCollect:ifNone: but some bracketing sorts it out, and I guess wh
> Am 07.06.2018 um 21:18 schrieb Esteban A. Maringolo :
>
> On 07/06/2018 13:59, Sven Van Caekenberghe wrote:
>>> On 7 Jun 2018, at 14:42, Norbert Hartl wrote:
>>> And safer. The current implementation of NeoJSONObject is not ver good. It
>>> returns nil on any missing key so you mask a lot o
Its sort of an awkward format, so maybe mapping is just not the way to go (but
I’m still keen to learn how to properly use it when it is appropriate). For the
record (if anyone is interested), an example json sample is here
(https://sprintdemo.prismic.io/api/v1/documents/search?q=%5B%5Bat(docume
Hey thanks - so maybe there are more legs to this - although it’s the decoding
I’m currently interested in (but I’m sure encoding will come up at some point
on my journey).
So it seems that my mapper can have multiple entries (that bit I had missed -
although seems obvious in retrospect now).
On 07/06/2018 17:21, Tim Mackinnon wrote:
> Hi - is there something I can read/study to get a bit more familiar with Json
> mapping? I have read the Pharo enterprise book (chapter 8).
>
> I’ve been using NeoJSONObject but then it occurred to me that maybe I could
> map better domain objects dire
Hi - is there something I can read/study to get a bit more familiar with Json
mapping? I have read the Pharo enterprise book (chapter 8).
I’ve been using NeoJSONObject but then it occurred to me that maybe I could map
better domain objects directly and simplify things. However it seems that the
On 07/06/2018 13:59, Sven Van Caekenberghe wrote:
>> On 7 Jun 2018, at 14:42, Norbert Hartl wrote:
>> And safer. The current implementation of NeoJSONObject is not ver good. It
>> returns nil on any missing key so you mask a lot of errors in your code
>> which I find dangerous.
>
> Haha, it was
Paul and Tim. Nope, still doesn't work. It might be some hacker-level
customization I've forgotten about.
Anyway, it's not worth my time or yours to track this down. Thanks for all
your help.
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> On 7 Jun 2018, at 14:42, Norbert Hartl wrote:
>
>
>
>> Am 07.06.2018 um 14:16 schrieb Tim Mackinnon :
>>
>> Thanks guys - it seems like I was on the right track.
>>
>> Making my own NeoJsonObject did work, but I will go back and see if I’m
>> really using the js nature of the values and
On Thu, Jun 7, 2018 at 4:59 PM Guillermo Polito
wrote:
> Hi Serge,
>
> What Pharo version are you on? What is your `file` object? If `file` is a
> FileReference, you need to know that by default, using `readStream`
> provides now an encoded file (to keep backwards compatibility with what
> most u
Hi Serge,
What Pharo version are you on? What is your `file` object? If `file` is a
FileReference, you need to know that by default, using `readStream`
provides now an encoded file (to keep backwards compatibility with what
most users were doing until now).
And I think that GZip should just decode
I try to decompress a gzip file like that:
compressed := file readStream.
stream := (GZipReadStream on: compressed) upToEnd asByteArray readStream.
but I have the following error:
Illegal leading byte for utf-8 encoding
--
Serge Stinckwich
UMI UMMISCO 209 (SU/IRD/UY1)
"Programs must be writte
> Am 07.06.2018 um 14:16 schrieb Tim Mackinnon :
>
> Thanks guys - it seems like I was on the right track.
>
> Making my own NeoJsonObject did work, but I will go back and see if I’m
> really using the js nature of the values and if for this, just an
> OrderedDictionary might be clearer.
>
How do you mean?
(1 to: 10) select: #odd thenCollect: [ :x | x ** 2 ] "-> #(1 9 25 49 81)"
It wouldn't make sense otherwise to have the collect method if it wouldn't
return anything.
Peter
On Thu, Jun 7, 2018 at 2:20 PM, Tim Mackinnon wrote:
> Hi - are the methods like #select:thenCollect: fr
Hi - are the methods like #select:thenCollect: frowned upon?
They seem quite readable , however in using them I’ve noticed that unlike the
core methods they done return the result of evaluation (they are missing a ^).
This is a shame, but possibly an oversight?
Tim
Sent from my iPhone
Thanks guys - it seems like I was on the right track.
Making my own NeoJsonObject did work, but I will go back and see if I’m really
using the js nature of the values and if for this, just an OrderedDictionary
might be clearer.
As an aside, I was doing some experiments with prismic.io (a headle
Yes they all work for me too - so we ‘re a bit confused by what your reporting
Greg, as they should all work on a Mac.
I’m sure we can help you get to the bottom of it.
Tim
Sent from my iPhone
> On 7 Jun 2018, at 06:39, Paul DeBruicker wrote:
>
> oh and a typo. Which should have been:
>
>
Great Subbu, thank you for the info. I will start with those docs.
Matias.
19 matches
Mail list logo