Skip to content

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

@lizmat

Description

@lizmat

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    languageChanges to the Raku Programming Language

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions