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 signature does not parse: couldn't find final ')' WAT? #3202

Closed
p6rt opened this issue Aug 2, 2013 · 4 comments
Closed

method signature does not parse: couldn't find final ')' WAT? #3202

p6rt opened this issue Aug 2, 2013 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Aug 2, 2013

Migrated from rt.perl.org#119133 (status was 'rejected')

Searchable as RT119133$

@p6rt
Copy link
Author

p6rt commented Aug 2, 2013

From @lizmat

[00​:50​:00] <lizmat> r​: multi method a( %t, *@​l ) { foo( -> $v { %t{$v} }, *@​l ) } # WAT? am I doing wrong here ?
[00​:50​:01] <+camelia> rakudo 1b5924​: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m␤Unable to parse expression in argument list; couldn't find final ')'␤at /tmp/EslBeuK3ls​:1␤------> �[32m a( %t, *@​l ) { foo( -> $v { %t{$v} }, *�[33m⏏�[31m@​l ) } # WAT? am I doing wrong here ?�[0m␤ expecting any of​:␤ postfix…
[00​:53​:54] <arcterus> lizmat​: are you trying to do this?
[00​:54​:29] <arcterus> multi method a(%t, *@​l) { foo( -> $v, *@​l { %t{$v} } ) }
[00​:56​:02] <lizmat> no, the sub should only be called with the one parameter
[00​:56​:11] <lizmat> by the subroutine
[00​:56​:43] <lizmat> the rest of the parameters are the values on which the sub should work
[00​:58​:42] <arcterus> what about this
[00​:59​:14] <arcterus> multi method a(%t, *@​l) { foo( -> $v { %t{$v} }, |@​l) }
[01​:00​:11] <lizmat> r​: multi method a(%t, *@​l) { foo( -> $v { %t{$v} }, |@​l) }
[01​:00​:13] <+camelia> rakudo 1b5924​: OUTPUT«Useless declaration of a has-scoped multi-method in mainline␤�[31m===�[0mSORRY!�[31m===�[0m␤Undeclared routine​:␤ foo used at line 1␤␤»
[01​:01​:15] <lizmat> I'll try it nonetheless in the actual situation after the running spectest is done
[01​:01​:48] <arcterus> k
[01​:09​:29] <lizmat> arcterus​: that compiles
[01​:10​:01] <lizmat> testing...
[01​:10​:03] <arcterus> cool.
[01​:11​:02] <lizmat> but tests fail
[01​:11​:20] <lizmat> :-(
[01​:13​:03] <lizmat> giving up for today​: it was just a code optimization anyway...
[01​:13​:33] lizmat submits rakudobug

@p6rt
Copy link
Author

p6rt commented Sep 25, 2013

From @jnthn

On Fri Aug 02 16​:15​:18 2013, elizabeth wrote​:

[00​:50​:00] <lizmat> r​: multi method a( %t, *@​l ) { foo( -> $v {
%t{$v} }, *@​l ) } # WAT? am I doing wrong here ?
[00​:50​:01] <+camelia> rakudo 1b5924​:
OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m␤Unable to parse expression in
argument list; couldn't find final ')'␤at /tmp/EslBeuK3ls​:1␤-----
->
�[32m a( %t, *@​l ) { foo( -> $v { %t{$v} }, *�[33m⏏�[31m@​l ) } #
WAT? am I doing wrong here ?�[0m␤ expecting any of​:␤
postfix…

It's not a signature problem, it's an *argument list* problem, which the
error says. And it places the mark next to the *, which is used to
slurp, but since this is being done in an argument list (as the second
argument to foo) then a | is needed.

I think Rakudo did a decent job of saying what was wrong (something in
an argument list) and placing the marker right next to the character to
blame. So, rejecting ticket as it doesn't clearly state a problem (or
desired resolution).

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Sep 25, 2013

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

@p6rt
Copy link
Author

p6rt commented Sep 25, 2013

@jnthn - Status changed from 'open' to 'rejected'

@p6rt p6rt closed this as completed Sep 25, 2013
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