my @a = (^10).list; @a = @a.hyper(:batch(5)).map({ LAST say "last"; āā
ā });
# rakudo-moar d10d69774: ( no output )
# expexted output at the end of a batch:
# last
# FIRST and NEXT are ignored too
# It may be sensible to fail on LAST in a HyperIterable and provide a
# LAST-BATCH phaser to avoid confusion when non-parallel code is
# changed.
FWIW, Iām making all phasers throw a NYI for the 2017.10 release. So we can figure out semantics until the next release.
On 22 Oct 2017, at 13:21, Wenzel P. P. Peppmeyer notifications@github.com wrote:
my @a = (^10).list; @a = @a.hyper(:batch(5)).map({ LAST say "last"; āā ā });
rakudo-moar d10d69774: ( no output )
expexted output at the end of a batch:
last
FIRST and NEXT are ignored too
It may be sensible to fail in LAST in a HyperIterable and provide a
LAST-BATCH phaser to avoid confusion when non-parallel code is
changed.
ā
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
They're simply NYI (which is the case for many things with hyper/race). FIRST should fire on the first element, and LAST on the last element, just as with a non-hyper loop. Batches shouldn't come in to it. The batch with the first element carries a flag indicating that, and it's the same for the batch with the last element. I don't think that we should need to make any guarantee that FIRST will run before iterations in another worker, nor that LAST will run after, since a loop with such order dependencies couldn't be parallelized anyway.
I suspect most situations where a LAST-IN-BATCH could be useful would generally be better done with a race reduce, which will be one of the next race-related things I implement (if nobody beats me to it).
could this issue be considered closed now that it throws a X::NYI?
Yes, thanks for the nudge!
Most helpful comment
FWIW, Iām making all phasers throw a NYI for the 2017.10 release. So we can figure out semantics until the next release.