> On 06 May 2016, at 04:02, Alex Brooke (via RT) <[email protected]>
> wrote:
>
> # New Ticket Created by Alex Brooke
> # Please include the string: [perl #128077]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org/Ticket/Display.html?id=128077 >
>
>
>> comb "foo";
> ===SORRY!=== Error while compiling <unknown file>
> Calling comb(Str) will never work with proto signature ($,, $?)
> at <unknown file>:1
> ------> <BOL><HERE>comb "foo";
>
> But:
>
>> "foo".comb
> (f o o)
Not sure this qualifies as a bug.
The first parameter to the “sub comb” is always the matcher. In the method
case, this is also the first parameter and can be easily omitted, because the
object is clearly the string to be worked on.
I guess we *could* add a
multi sub comb(Str:D $s) { $s.comb }
but it feels to me this is too much DWIM, and very close to a WAT?
Please note that you can also say:
comb 1,”foo”
to get the desired result.
Liz