On Wed, Sep 26, 2018 at 8:49 PM ToddAndMargo <toddandma...@zoho.com> wrote:

>
> $ p6 '"a b c d e".words[ 2, 4 ].say;'
> (c e)
>
> or
>
> $ p6 '"a b c d e".words()[ 2, 4 ].say;'
> (c e)
>
> I am selecting the 2nd and 4th word starting from zero.  Inside
> the brackets I am asking it to select th e 2nd and 4th words for me.
>
> I am NOT asking it to limit my request to Infinity.
>
>
Correct. You put them inside the [ ]. They belong to the [ ] role of
Positional.
The words function knows nothing whatsoever about this. It belongs to
Positional.

If you put it inside the parentheses instead of the brackets, it belongs to
the Callable, and will be given to words(). Now it is applied as the $limit
on how many times to split the string.

Where does it state that
>
> $ p6 '"a b c d e".words(3).say;'
> (a b c)
>
> means the first three words, starting at zero?
>

At least three of us have told you that this is $limit, because it is in
the parentheses instead of in the brackets.
But you want words() to have a $selection there instead, so words() can be
a list for you instead of letting the list be a list.
Why is it so important that words() pretend to be a list, when we have
lists that know how to be lists?
Why is it so important that you not have to find out what a list is, but
instead that words() must pretend that it is a list?

Nobody understands why you insist that lists are wired into the functions
that produce them and can't possibly know that they can be indexed. And
that we must document every function that produces a listas actally itself
being a list, including magical $selection parameters, when that is what
lists are for. What do you think lists are for, if words() and lines() have
to be fake lists to work instead of producing real lists?

-- 
brandon s allbery kf8nh
allber...@gmail.com

Reply via email to