Open dha opened 13 years ago
Re: all/junction - I agree. To resolve, the code could be changed to: return not ?@rest.grep( { $first < $_ } ); If we keep using all(), we should at least cast to Bool so that we don't return a junction: return ?( $first >= all(@rest) );
re: Line 10. I am looking at this, but my understanding is clouded by Rakudo's incomplete implementation of list binding. Thoughts on your questions:
First, the use of all() is unexplained. Some of us are familiar with junctions from Damian's Quantum::Superpositions talk, but the docs probably shouldn't require that you have been at a Perl Conference ten years ago to make sense of it. :-) Also, if you play with the code in this section, you find that what gets returned is a junction, which really won't make sense to the uninitiated.
Also, the first paragraph refers to "ordinary slicing access", but what does that refer to? Perl5 style slices? Other than the reference to the "Zen slice", there's been no reference to slicing in this document. Is the first section of the first example supposed to be "ordinary slicing", followed by the second section which is "signature binding"? Since neither does the unpacking in the actual signature of the subroutine, I find that unclear.
Next, there is the line 10 of the first example: "my :($first, *@rest) := (|@a)". A couple of issues with this... What's that colon doing after the my (I suspect this one is a typo)? What does the := operator do? Why are we creating a capture on the right hand side of the expression?