4 ms·
By set operations I was more specifically thinking of intersection and union. Testing if an element belongs to a set can indeed be done with junctions but that
by grondilu 11y ago
By set operations I was more specifically thinking of intersection and union. Testing if an element belongs to a set can indeed be done with junctions but that's pretty much it.
The third example shows the so-called auto-threading behavior. I think it's significantly different than what you can do with sets.
A Junction in Perl 6 is "a superposition of data values pretending to be a single value". So for instance any algebraic expression can be used with a junction as if it was a scalar. The result will be a junction.
In this example the expression is $_ %% 2, which is Perl 6's way of writing the boolean statement "the variable $_ is divisible by 2". We use this expression with ($a & $b) instead of $_.