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

Prefix op parsing takes precedence over subroutine parsing, should not #2832

Closed
p6rt opened this issue Jul 20, 2012 · 7 comments
Closed

Prefix op parsing takes precedence over subroutine parsing, should not #2832

p6rt opened this issue Jul 20, 2012 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Jul 20, 2012

Migrated from rt.perl.org#114210 (status was 'resolved')

Searchable as RT114210$

@p6rt
Copy link
Author

p6rt commented Jul 20, 2012

From @moritz

10​:58 < moritz> r​: say not(0) + 1
10​:58 <+p6eval> rakudo 4eeffc​: OUTPUT«False␤»
10​:59 < moritz> r​: say (not 0) + 1
10​:59 <+p6eval> rakudo 4eeffc​: OUTPUT«2␤»

But S03 says​:

In term position, any identifier followed immediately by a
parenthesized expression is always parsed as a term representing
a function call even if that identifier also has a prefix meaning,
so you never have to worry about precedence in that case. Hence​:

  not($x) + 1 # means (not $x) + 1
  abs($x) + 1 # means (abs $x) + 1

@p6rt
Copy link
Author

p6rt commented Nov 18, 2014

From @usev6

This is still the same as in 2012​:

$ perl6 -e 'say not(0) + 1'
False
$ perl6 -e 'say (not 0) + 1'
2

I added a test (fudged "todo") in S03-operators/precedence.t with commit Raku/roast@156e7e7

1 similar comment
@p6rt
Copy link
Author

p6rt commented Nov 18, 2014

From @usev6

This is still the same as in 2012​:

$ perl6 -e 'say not(0) + 1'
False
$ perl6 -e 'say (not 0) + 1'
2

I added a test (fudged "todo") in S03-operators/precedence.t with commit Raku/roast@156e7e7

@p6rt
Copy link
Author

p6rt commented Nov 18, 2014

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 3, 2015

From @usev6

This works now​:

$ perl6 -e 'say not(0) + 1'
2

$ perl6 -e 'say (not 0) + 1'
2

The test was unfudged with commit Raku/roast@0f47ac7711

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Mar 3, 2015

From @usev6

This works now​:

$ perl6 -e 'say not(0) + 1'
2

$ perl6 -e 'say (not 0) + 1'
2

The test was unfudged with commit Raku/roast@0f47ac7711

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Mar 3, 2015

@usev6 - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Mar 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant