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

Feed operators final sub / routine parens #6011

Open
p6rt opened this issue Jan 19, 2017 · 3 comments
Open

Feed operators final sub / routine parens #6011

p6rt opened this issue Jan 19, 2017 · 3 comments
Labels
Bug

Comments

@p6rt
Copy link

@p6rt p6rt commented Jan 19, 2017

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

Searchable as RT130588$

@p6rt
Copy link
Author

@p6rt p6rt commented Jan 19, 2017

From sam@linux.com

The docs state the following regarding the feed operators​:

In the case of routines/methods that take a single argument or where the first argument is a block, it is often required that you call with parentheses (though this is not required for the very last routine/method).

https://docs.perl6.org/language/operators#index-entry-feed

In the example, sort(), flat(), printf(), sprintf() can omit ()​:

"my string" ==> sort
"my string" ==> flat
"my string" ==> printf
"my string" ==> sprintf

but fails with others (this isn't an exhaustive list)​:

"my string" ==> say
===SORRY!=== Error while compiling​:
Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun
------> "my string" ==> say;

"my string" ==> print
===SORRY!=== Error while compiling​:
Unsupported use of bare "print"; in Perl 6 please use .print if you meant $_, or use an explicit invocant or argument, or use &print to refer to the function as a noun
------> "my string" ==> print;

"my string" ==> reverse
===SORRY!=== Error while compiling​:
Unsupported use of bare "reverse"; in Perl 6 please use .reverse if you meant $_, or use an explicit invocant or argument, or use &reverse to refer to the function as a noun
------> "my string" ==> reverse;

This bug is similar to https://rt-archive.perl.org/perl6/Ticket/Display.html?id=112396

Tested on 2016.12, v2016.12.113.gd.1.da.1.ba

@p6rt
Copy link
Author

@p6rt p6rt commented Jan 19, 2017

From @geekosaur

On Thu, Jan 19, 2017 at 6​:43 AM, Sam M <perl6-bugs-followup@​perl.org> wrote​:

"my string" ==> reverse
===SORRY!=== Error while compiling​:
Unsupported use of bare "reverse"; in Perl 6 please use .reverse if you
meant $_, or use an explicit invocant or argument, or use &reverse to refer
to the function as a noun
------> "my string" ==> reverse;

This bug is similar to https://rt-archive.perl.org/perl6/Ticket/Display.html?id=112396

Actually, it's not; it's just the "catch common perl 5 idioms that don't do
the same thing in perl 6" (specifically, reliance on $_ as default
parameter) interacting oddly with a semantic perl 5 didn't have. Arguably
there should be a way to suppress the p5-trap in that situation.

--
brandon s allbery kf8nh sine nomine associates
allbery.b@​gmail.com ballbery@​sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

@p6rt
Copy link
Author

@p6rt p6rt commented Jan 19, 2017

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

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.