> Il giorno 26 set 2018, alle ore 08:57, Todd Chester <toddandma...@zoho.com> 
> ha scritto:
> 
> Hi All,
> 
> Over on
>    https://docs.perl6.org/routine/words
> I see
> 
>   multi method words(Str:D $input: $limit = Inf --> Positional)

$input is the method invocant (hence the “:”) constrained to a defined string 
object.

$limit is the number of words (chunks separated by whitespace) you may want 
from $input

- -> constrains the return type to an object that consumes the role of 
Positional


> HOW IN THE WORLD did they convert `$limit = Inf` into an
> array index!?!?

I think $limit is the number of words you want, not an array index.

> https://docs.perl6.org/type/Num#Inf
> And `Inf` means a number larger than Perl can handle or Infinity.
> What does that have to do with ANYTHING!?

I think the method returns a lazy Seq, so no limits.

> Yours in confusion,
> -T
> 
> And the worst part is that I know how to use "words" and use it
> frequently.  And the documentation is a nightmare to understand.
> 
> Link to Positional:
> https://docs.perl6.org/type/Positional
>   Role for objects which support indexing them using
>   postcircumfix:«[ ]» (usually list-like objects).
>   Example types with Positional role include List,
>   Array, Range, and Buf.
> 
> I like him using `Str:D $input:` rather than just `Str:D:`
> and it is more intuitive

Reply via email to