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 after blocks passed to list-operator methods are parsed incorrectly #1148

Closed
p6rt opened this issue Jul 19, 2009 · 8 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Jul 19, 2009

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

Searchable as RT67700$

@p6rt
Copy link
Author

p6rt commented Jul 19, 2009

From minimiscience@gmail.com

The line "say (^10).map​: { $^n * 2 + 1 }.perl" yields the error
"Parameter type check failed; expected something matching Callable()
but got something of type Str() for expr in call to map" when parsed,
indicating that the .perl is being treated as a method call on the
block. However, S12 clearly states​:

Also note that if any term in a list is a bare closure or pointy sub,
it will be considered to be the final argument of its list unless the
closure’s right curly is followed immediately by comma or colon. In
particular, a method call does *not* extend the list, so you can say​:

@​list\.grep​: \{ $\_ % 2 \}\.map​: \{ $\_ − 1 \}\.say

and that will be taken as equivalent to

@​list\.grep\(\{ $\_ % 2 \}\)\.map\(\{ $\_ − 1 \}\)\.say

This problem was observed on Rakudo Perl #​18 ("Pittsburgh") with
revision 39599 of Parrot on Mac OS X 10.5.6.

@p6rt
Copy link
Author

p6rt commented Jul 20, 2009

From @kyleha

On Sun Jul 19 13​:48​:45 2009, minimiscience@​gmail.com wrote​:

The line "say (^10).map​: { $^n * 2 + 1 }.perl" yields the error
"Parameter type check failed; expected something matching Callable()
but got something of type Str() for expr in call to map" when parsed,

This problem was observed on Rakudo Perl #​18 ("Pittsburgh") with
revision 39599 of Parrot on Mac OS X 10.5.6.

I've confirmed this with Pittsburgh on Ubuntu Linux, but on Rakudo
415514b69e27cdee4d3e97e7216807e9e142766f, it's saying simply "Null PMC
access in invoke()".

@p6rt
Copy link
Author

p6rt commented Jul 20, 2009

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

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

From @bbkr

NOM

still broken

bbkr​:nom bbkr$ ./perl6 -e 'say (^10).map​: { $^n * 2 + 1 }.perl'
Method 'count' not found for invocant of class 'Str'
  in method reify at src/gen/CORE.setting​:3634
  in method reify at src/gen/CORE.setting​:3539
  in method reify at src/gen/CORE.setting​:3539
  in method gimme at src/gen/CORE.setting​:3876
  in method eager at src/gen/CORE.setting​:3852
  in method join at src/gen/CORE.setting​:854
  in method Str at src/gen/CORE.setting​:3817
  in method gist at src/gen/CORE.setting​:4053
  in sub say at src/gen/CORE.setting​:4663

@p6rt
Copy link
Author

p6rt commented May 25, 2015

From @usev6

There already was one test for the quoted code from S12 in S12-methods/syntax.t. I completed it with the original example from this ticket with commit Raku/roast@753918011e

@p6rt
Copy link
Author

p6rt commented Oct 10, 2015

From @FROGGS

Design docs got aligned to rakudo so that method calls on blocks just do what one would expect.

Patch​: Raku/old-design-docs@d1d502fb71
Tests​: Raku/roast@95a28225ed

Closing ticket.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 10, 2015

From @FROGGS

Design docs got aligned to rakudo so that method calls on blocks just do what one would expect.

Patch​: Raku/old-design-docs@d1d502fb71
Tests​: Raku/roast@95a28225ed

Closing ticket.

@p6rt p6rt closed this as completed Oct 10, 2015
@p6rt
Copy link
Author

p6rt commented Oct 10, 2015

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

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