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

"Endpoint" methods should not have *%_ in their signature #444

Open
lizmat opened this issue Oct 7, 2024 · 0 comments
Open

"Endpoint" methods should not have *%_ in their signature #444

lizmat opened this issue Oct 7, 2024 · 0 comments
Labels
language Changes to the Raku Programming Language

Comments

@lizmat
Copy link
Collaborator

lizmat commented Oct 7, 2024

As again pointed out in rakudo/rakudo#2368.

If a method is sure to not be calling any other methods, then it should have the option of not automatically codegenning the *%_ in their signature. If that was done for the .head method, then this example would fail with a very useful error:

% raku -e 'my $n = 3; say (^10).head:$n' 
Cannot resolve caller head(Range:D, :n(Int)); none of these signatures matches:
    ($head, +values)

as opposed to just silently do the wrong thing:

% raku -e 'my $n = 3; say (^10).head:$n' 
0

because the :$n silently gets eaten, so it works as:

% raku -e 'my $n = 3; say (^10).head' 
0
@lizmat lizmat added the language Changes to the Raku Programming Language label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language Changes to the Raku Programming Language
Projects
None yet
Development

No branches or pull requests

1 participant