I may not be the typical user but I like 4 ~~ (1,2,3,4) not meaning 4 ~~
any(1,2,3,4). I would only want ~~ List to be True if the LHS is Positional
(maybe Iterable) that has the same values in the same order.

If 4 ~~ (1,2,3,4) returns true, shoulnd't (1,4) ~~ (1,2,3,4) also be true?
I don't think we want to go down this path.

LL

On Mon, Apr 25, 2016 at 4:36 AM Alex Jakimenko <perl6-bugs-follo...@perl.org>
wrote:

> # New Ticket Created by  Alex Jakimenko
> # Please include the string:  [perl #127980]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org/Ticket/Display.html?id=127980 >
>
>
> Code:
> say 4 ~~ (4,5,6,7)
>
> Result:
> False
>
> Most people expect that it will check if the list on the RHS contains 4,
> but that's not what it does. The right way to do it is to use any(4,5,6,7).
>
> Another thing that it could possibly do is to count the number of elements
> in the list, as in 4 == +(4,5,6,7), but again that's not what it does.
>
> Example above clearly shows that both of these assumptions are wrong.
>
> So what does it do?
>
> The relevant piece of code is here:
> https://github.com/rakudo/rakudo/blob/nom/src/core/List.pm#L426 . In
> other words, it always returns False, but it also returns empty list if RHS
> list is empty or a RHS list itself if the first element of it is a Match
> object.
>
> Does it make any sense? Not at all, at least to a typical user.
>
>
> The proposal is to make it DWIM. That is, make 4 ~~ (4,5,6,7) work like 4
> (elem) (4,5,6,7).
>
> See also IRC log: http://irclog.perlgeek.de/perl6/2016-04-24#i_12386065
>

Reply via email to