On Fri Apr 24 05:02:04 2009, masak wrote:
> <moritz_> rakudo: for [1], [2]|[3], [4] -> @a { say @a.elems }
> <p6eval> rakudo 9a5305: OUTPUT«1␤Non-Positional argument or Positional
> of wrong element type for @a in call to _block34 [...]
> <moritz_> bug?
> <moritz_> don't know about junctions and arrays...
> * masak submits, just in case
> 
> If the new standard is to not autothread in for loops, then this is in
> fact in order. One might possibly want a more explanatory error
> message, though, since the contents of the junction actually match the
> signature.

The new standard is that the default type in pointy blocks is Object,
but Positional is a narrower type than that and thus auto-threading
should happen. A side-effect of clearing up error handling that I did
earlier today means that we do now hit the junction fallback, which is
good and essentially resolves the issue in this ticket. I guess a good
test case is:

> sub foo(@a) { say @a.elems }
> foo([1,2]|[3,4,5])
2
3

Which works now. However, there are still issues with auto-threading and
pointy blocks, as described in RT#63686, that make the original example
not quite work.

Thus I am assigning this ticket to moritz++ to request tests of the form
I put above (for auto-threading over a junction of hashes too would be
good), and suggest afterwards it's either closed or merged into 63686.

Thanks,

Jonathan

Reply via email to