Hi,
the current spec doesn't allow immutable containers to call .map with a
block that implicitly uses $_ as an implicit parameter.
Here's why:
S06 says
> The C<$_> variable functions as a placeholder in a block without any
> other placeholders or signature. Any bare block without placeholders
> really has a parameter like this:
>
> -> $_ is rw = OUTER::<$_> { .mumble }
So $_ is marked as rw, which is checked at binding time.
Now lists are immutable, meaning that you can't bind a list item rw, so
even if the block doesn't try to modify $_, calling the { .say } block
fails.
(Note that 'for' has the same problem)
How should that be resolved? Should a temporary variable be created that
can be changed, without any effect? or should it fail() on detecting a
modification? Somehow this approach seems very backward to me...
Cheers,
Moritz