The doc website creates the pages under "routine/" by collecting every
type's methods and relevant subs of that name and putting them all on a
page.

It's a very unfortunate accident that the one for Telemetry::Sampler
ends up at the top, because right below that is the one for Mu, which is
the most general one that also links to the "documentation on object
construction" where things are explained clearly in a tutorial style.

Telemetry::Sampler isn't a routine, it's a class. You can follow the
link labelled "from Telemetry::Sampler" to get to the documentation of
the class by that name, which explains what it is, how you get it, and
how you use it.

I'll file a bug for the "new" routine page.

Hope that helps!
  - Timo

On 14/09/2018 12:30, Todd Chester wrote:
> Hi All,
>
> What exactly is going on with .new?
>
>   https://docs.perl6.org/routine/new
>   method new(Telemetry::Sampler: @instruments --> Telemetry::Sampler:D)
>
> The whole thing went over my head.  It looks like
> specifications for the developers, but I really can't
> tell.  And it looks like it might be really handy.
>
> What can I use it for?
>
>
> Also, does "Telemetry::Sampler" mean what it does in Perl 5,
> which is a routine called "Sampler" found in the module
> called "Telemetry"?
>
> Many thanks,
> -T

Reply via email to