Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method calls with colonpairs in name (<1 2 3>.grep:k: 1) #5136

Open
p6rt opened this issue Feb 14, 2016 · 3 comments
Open

Method calls with colonpairs in name (<1 2 3>.grep:k: 1) #5136

p6rt opened this issue Feb 14, 2016 · 3 comments
Labels
NYI Features not yet implemented

Comments

@p6rt
Copy link

p6rt commented Feb 14, 2016

Migrated from rt.perl.org#127539 (status was 'open')

Searchable as RT127539$

@p6rt
Copy link
Author

p6rt commented Feb 14, 2016

From @AlexDaniel

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

@p6rt
Copy link
Author

p6rt commented Feb 14, 2016

From @LLFourn

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​:

# 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-archive.perl.org/perl6/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

@p6rt
Copy link
Author

p6rt commented Feb 14, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt added the NYI Features not yet implemented label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NYI Features not yet implemented
Projects
None yet
Development

No branches or pull requests

1 participant