Junctions continue to surprise me:

    my $junction = any( 'a', 'b', 'c' );
    my $char = 'b';
    say $char ~~ $junction; # True
    say $char eq $junction; # any(False, True, False)

    $char = 'e';
    say $char ~~ $junction; # False
    say $char eq $junction; # any(False, False, False)

I would've thought that there'd be no difference there
The smartmatch checks that it's comparing string types,
and does something like an eq on them, right?
So why would going straight to an eq be different?

But then, there are other cases where junction-in,
junction-out is the only thing that makes sense:

    say $junction ~ 'z';
    # any(az, bz, cz)

Reply via email to