develooper Front page | perl.perl6.users | Postings from February 2018

Junctions now being stringified as one alternative per line?

Thread Next
From:
Sean McAfee
Date:
February 24, 2018 21:50
Subject:
Junctions now being stringified as one alternative per line?
Message ID:
CANan03asi-yYad1t_4CAqfWr8xj=PDHaRyKOwhaCpGBo-jtF6w@mail.gmail.com
I recently upgraded to Rakudo 2018.01 and just now encountered some
perplexing behavior.

Junctions, regardless of type, are being stringified one alternative per
line.  1 & 2, 1 | 2, 1 ^ 2, and none(1, 2) are all displayed as a 1, a
newline, and 2.  Previously I would see eg. "all(1, 2)", which now I have
to call .perl on the junction to see.

Was this change intentional?  It's hard to see it as an improvement,
particularly considering how no information about the junction type is
presented.

I discovered the behavior by trying to print the return value of a function
that returned a junction, something like this:

sub f { all @_ }

say "$_ => {f |$_}" for <1 2 3>, <4 5 6>;

This prints:

1 2 3 => 1
1 2 3 => 2
1 2 3 => 3
4 5 6 => 4
4 5 6 => 5
4 5 6 => 6

It looks like the say is being hit six separate times, when it clearly
should be called only twice...which it is, but it's impossible to tell from
the output.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About