I see the same as Joseph:

$ raku
Welcome to 𝐑𝐚𝐤𝐮𝐝𝐨™ v2021.06.
Implementing the 𝐑𝐚𝐤𝐮™ programming language v6.d.
Built on MoarVM version 2021.06.

To exit type 'exit' or '^D'
> say do given all(3,7) { when Int { "both are Int" }; default {"not
similar"} };
not similar
>  say so do all(3,7) ~~ Int;
True
> given all(3,7) { say $_; say $_.WHAT; }
all(3, 7)
(Junction)
> given all(3,7) { say so $_ ~~ Numeric; }
True
> $*VM
moar (2021.06)
>

On Tue, Nov 2, 2021 at 9:45 AM Joseph Brenner <doom...@gmail.com> wrote:

> A given/when construct using a junction isn't quite doing what I'd expect.
>
> I'd thought that that would confirm that both elements were Int:
>
>   say do given all(3,7) { when Int { "both are Int" }; default {"not
> similar"} };
>   ## not similar
>
> But this does what I thought it would:
>
>   say so do all(3,7) ~~ Int;
>     # True
>
> And the given seems to put the junction in $_ as expected:
>
>   given all(3,7) { say $_; say $_.WHAT; }
>     # all(3, 7)
>     # (Junction)
>
> And you can use that junction in a smartmatch explicitly
>
>   given all(3,7) { say so $_ ~~ Numeric; }
>     # True
>

Reply via email to