On 9/26/18 6:03 PM, Timo Paulssen wrote:
You're still missing that the words method doesn't "take the [2,4]". The
operation that [2,4] does takes place after the words() thing has
already done its work.

You could actually say that every method takes [0]. Try it!

Your confusion looks a bit similar to seeing

     multi sub exp(Cool:D $pow, Cool:D $base?)

and the example code

     say exp(2, 10) + 5

and then asking "where in the multi sub exp in the docs does it say that
i can add 5?"

They are separate things that work together.

The return value of words being Positional means mainly that it gives
you something you can use [ ] on.

The part of words where it says $limit = Inf means that if no number is
passed there, that the value Inf is used. Inf is not a Type, and even
though you can put a type on the right side of an assignment, it will
"just" be used as a value.

I'm not sure why you wrote "I am NOT asking it to limit my request to
Infinity.", maybe if you explain that a little more we can figure out
better what's confusing you.


Where does

     multi method words(Str:D $input: $limit = Inf --> Positional)

state that I can do such?

I ask this because not all methods will take []


$ p6 '"a b c d e".contains( "a","b" ).say;'
Cannot convert string to number: base-10 number must begin with valid
digits or '.' in '⏏b' (indicated by ⏏)
   in block <unit> at -e line 1

$ p6 '"a b c d e".contains( 1, 3 ).say;'
Ambiguous call to 'contains(Str: Int, Int)'; these signatures all match:
:(Str:D: Cool:D $needle, Cool:D $pos, *%_)
:(Str:D: Cool:D $needle, Cool:D $pos, *%_)
   in block <unit> at -e line 1


You aren't using [] there, you're just putting the strings and numbers
inside the (), which is the difference that people are trying to
explain, but not finding the right words to make you understand. Can you
help us by explaining how you get from "every method takes [ ]" to "i'll
try it with ()"? Perhaps some place wrongly claimed that () and [] are
the same? That might require a bit of re-wording in the docs, then.

Hope any of that helps
   - Timo


Hi Timo,

Curt explained it to me.

Your explanation was marvelous written.  That takes
talent!  I feel a little bit guilty not stopping
you sooner.

Okay, guilt over.  Would you take a swipe at "$limit = Inf"

Many thanks,
-T

Reply via email to