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
Allow named parameters with literal values in signatures #5310
Comments
From @dwarringRakudo is pretty good at parsing literal arguments as positional parameters. For example: multi sub s(True) { 'case1' } # Bool $ where $_ for 1+1==2, 'fred', 42 -> $val { If I refactor the above from a positional to a named parameter, then I need to be a bit more explicit. Something like: multi sub s(Bool :$val! where $_) { '#case1' } for 1+1==2, 'fred', 42 -> $val { Can the handling of named arguments be improved to more like the positional case? I was hoping for something like: multi sub s(:val) { "#case1" } Or something similar (None of these parse at the moment). |
@smls - Status changed from 'new' to 'open' |
From @dwarringAnother case, a false boolean value: multi sub s(False) { 'case4' } rfc for positional: muli sub s(:!val ) { 'case4' } # Bool $ where !$_ On Mon May 09 21:57:05 2016, david.warring wrote:
|
Migrated from rt.perl.org#128108 (status was 'open')
Searchable as RT128108$
The text was updated successfully, but these errors were encountered: