On 23 Mar 2015, at 07:57, stepharo <stepharo@free.fr> wrote:
Le 22/3/15 23:01, Sven Van Caekenberghe a écrit :
On 22 Mar 2015, at 22:40, stepharo <stepharo@free.fr> wrote:
Le 22/3/15 22:05, Sven Van Caekenberghe a écrit :
On 22 Mar 2015, at 21:44, Denis Kudriashov <dionisiydk@gmail.com> wrote:
Hi
It is another perfect task for XStreams:
r := #('a12' 'b12' 'a13' 'a14' 'c23' 'a16') reading selecting: [:each | each first = $a]. r get > a12 r get > a13 Beautiful ! Yes but with r next. r next The choice for different selector names was intentional, by design. To avoid confusion, because #next and #get are not 100% identical (semantically). This is an important point. No I asked martin personally. This is the real reason. There were also experimenting to offer an API closer to other language. So that we have r get. r next: 4
IIRC, one difference between #get and #next is that get cannot return nil and will throw an Incomplete exception when EOF next can return nil and might throws an Exception Changing the meaning of an existing selector will cause many problems and discussions. People will think they do not have to change anything and they will be wrong.
superb inconsistencet
I was reading the XTreams API recently but this is forbidden for me to open another project before finishing what I started. Now if somebody else would like to help pushing Xtreams in Pharo 50. :) Well, it does/did load OK in Pharo 3 and probably will in 4 too.
Yes loading is just a part of the story :) We should remove the old ones.
And we should revise the API because I **hate ++, -=, +=
Yeah, but is not because it looks a bit like C++ that it is no longer Smalltalk, these are still normal messages. But yes, some API discussions are possible.
Thx Denis.
2015-03-22 20:47 GMT+03:00 stepharo <stepharo@free.fr>: Hi
I need a collection that does the following:
col := #('a12' 'b12' 'a13' 'a14' 'c23' 'a16') asMyNewCollection. col findFirst: [:each | each first = $a] > a12 col findFirst: [:each | each first = $a] > a13
Do you know a collection that would work? So I have the impression that such behavoir could be defined with a kind of methods wrapper.
Stef