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

There's no way to do .elems on a List of positional captures, because internals are poking out of the Match #101

Closed
p6rt opened this issue May 25, 2008 · 4 comments

Comments

@p6rt
Copy link

p6rt commented May 25, 2008

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

Searchable as RT54796$

@p6rt
Copy link
Author

p6rt commented May 25, 2008

From @masak

The following run shows how the fact that a list of captured
positionals barfs on an .elems call​:

  $ parrot perl6.pbc
  > rule Foo { (\d+) }
  > "1234 x" ~~ Foo; say $/;
  1234
  > "1234 x" ~~ Foo; say @​($/);
  1234
  > "1234 x" ~~ Foo; say @​($/).WHAT;
  List
  > "1234 x" ~~ Foo; say @​($/).elems;
  Method 'elems' not found for invocant of class 'ResizablePMCArray'
  > # wtf?!
  > say [1,2,3,4].elems
  4
  > say <1 2 3 4>.elems
  4
  $

// Carl

@p6rt
Copy link
Author

p6rt commented May 26, 2008

From @pmichaud

On Sun, May 25, 2008 at 09​:37​:18AM -0700, Carl Mäsak wrote​:

The following run shows how the fact that a list of captured
positionals barfs on an .elems call​:

  $ parrot perl6\.pbc
  > rule Foo \{ \(\\d\+\) \}
  > "1234 x" ~~ Foo; say $/;
  1234
  > "1234 x" ~~ Foo; say @&#8203;\($/\);
  1234
  > "1234 x" ~~ Foo; say @&#8203;\($/\)\.WHAT;
  List
  > "1234 x" ~~ Foo; say @&#8203;\($/\)\.elems;
  Method 'elems' not found for invocant of class 'ResizablePMCArray'
  > \# wtf?\!

Now fixed in r27818​:

  $ ./parrot perl6.pbc
  > rule Foo { (\d+) }
  > "1234 x" ~~ Foo; say @​($/).elems;
  1
  >

Pm

@p6rt
Copy link
Author

p6rt commented May 26, 2008

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

@p6rt
Copy link
Author

p6rt commented May 27, 2008

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

@p6rt p6rt closed this as completed May 27, 2008
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