I think this does highlight something we probably should document more.

How to read signatures. Because it's a *very* powerful part of the language
that if you don't understand you're only using it at half strength.

multi method contains(Str:D: Cool:D $needle, Cool:D $pos --> Bool:D)

If not some documentation magic, it's a core part of the language. It tell
you this method is called on a defined Str (Str:D:) it takes 2 positional
arguments which have to be defined Cool types ($needle and $pos) and it
returns a Boolean.

That is the code as it will be written in the Str Role.

I *highly* advise learning how signatures work.

On Mon, 9 Dec 2019 at 14:54, ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> On 2019-12-09 02:00, JJ Merelo wrote:
> > Other than that, it's clear from the context that it returns a Boolean
>
> JJ,
>
> You are a teacher.  In technical writing, you NEVER leave
> anything to "Context", even if it is "intuitively
> obvious to the student and left for him to figure out
> on his own".
>
> If you meant until the commit gets in place just
> go by context, then I apologize for misinterpreting
> you.
>
> The commit looks nice.  I would have liked it if they
> had used the "the needle and the haystack" instead of
> just "needle" (what am I poking?), but I can live
> with what they came up with.
>
> multi method contains(Str:D: Cool:D $needle, Cool:D $pos --> Bool:D)
>
> In the above, it is not real obvious to the Riff-Raff
> (me), who is not have developer level ledge, that the
> "Str:D" in inside the parenthesis, but instead feeding
> the method.  You have to get use to the cryptography.
>
> You still need to change the target audience of the docs
> from the Developers to the Rakoons.
>
> -T
>


-- 
Simon Proctor
Cognoscite aliquid novum cotidie

http://www.khanate.co.uk/

Reply via email to