Skip Menu |
Report information
Id: 127539
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: Method calls with colonpairs in name NYI (<1 2 3>.grep:k: 1)
Download (untitled) / with headers
text/plain 444b
Code: my @h = <1 1 2 1 1>; say @h.grep:k: 1 Result: (1 1 1 1) I expected to see (0 1 3 4) which is the result of a very similar code snippet: my @h = <1 1 2 1 1>; say @h.grep: 1, :k However, it is totally fine to me if such code is supposed to do something else (e.g adverb the method name itself instead of passing named arguments, whatever that means). See IRC log for jnthn comments: http://irclog.perlgeek.de/perl6/2016-02-13#i_12036804
Date: Sun, 14 Feb 2016 03:17:23 +0000
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
To: perl6-compiler [...] perl.org, bugs-bitbucket [...] rt.perl.org
Subject: Re: [perl #127539] Method calls with colonpairs in name NYI (<1 2 3>.grep:k: 1)
in grammar actions it's valid to create methods like:

name:sym<variant>($/) { ... }

so I guess '$object.name:k:' args could work but :k<v>, would be tricky because it would be hard to differentiate between invoking '$object.name:k<v>: args' and '$object.name:sym<variant>: args'.

On Sun, Feb 14, 2016 at 1:43 PM Alex Jakimenko <perl6-bugs-followup@perl.org> wrote:
Show quoted text
# New Ticket Created by  Alex Jakimenko
# Please include the string:  [perl #127539]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=127539 >


Code:
my @h = <1 1 2 1 1>;
say @h.grep:k: 1

Result:
(1 1 1 1)


I expected to see (0 1 3 4) which is the result of a very similar code snippet: my @h = <1 1 2 1 1>; say @h.grep: 1, :k
However, it is totally fine to me if such code is supposed to do something else (e.g adverb the method name itself instead of passing named arguments, whatever that means).

See IRC log for jnthn comments: http://irclog.perlgeek.de/perl6/2016-02-13#i_12036804


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org