HaloO,
Ingo Blechschmidt wrote:
Whitespace is significant:
say zip @odd, @even; # &zip gets two arguments, result is
# 12345678.
say zip(@odd, @even); # &zip gets two arguments, result is
# 12345678.
say zip (@odd, @even); # &zip gets only one argument, the flattened
# list (@odd, @even), containing the
Why flattened? Shouldn't that be *(@odd, @even)?
# elements (1,3,5,7,2,4,6,8). Then &zip
Why not ([1,3,5,7],[2,4,6,8]) list of two array refs?
# tries to zip this one list, resulting in
# 13572468.
If the list of two array refs is not flattened, the result should be
12345678 because how should &zip distinguish it from the other cases?
The crux of the first case not requiring parens is that &zip is declared
as listop and as such consumes the @even after the , which otherwise would
be left for &say. And if &say weren't declared/assumed listop, the @even
would be evaluated in Void context and not appear in the print at all.
Or do I miss something important? E.g. has () become a circumfix deref op?
--
$TSa.greeting := "HaloO"; # mind the echo!