On 2020-05-31 12:48, Veesh Goldman wrote:
well, literally it would mean something like "a direct result of inability to read is to not understand", which in context should mean if you can't read you won't understand. But I think the point was made.


Hi Veesh,

Please help me with my reading skills here.

https://docs.raku.org/routine/starts-with

multi method starts-with(Str:D: Str(Cool) $needle, :i(:$ignorecase), :m(:$ignoremark) --> Bool:D)

Does this or does this not state that the "Haystack"
(invocant) is required to be defined ("Str:D:")?

If I am reading it correctly, is requires a "defined"
("D") Haystack (invocant).  Am I misreading something?

Running a test, the method DO NOT check for defined:

    p6 'my $x; say $x.starts-with( "1" );'
    No such method 'starts-with' for invocant of type
    'Any' in block <unit> at -e line 1

What am I misreading?  Does it say anywhere that the
Haystack in not defined? Does it way anywhere that I
violated the requirement that the Haystack be defined?

And what is "No such method 'starts-with'" suppose to
mean?  I am staring at the method on right on the manual
page.  Did the developers forget to include "opens-with"
on my version of Raku?  Obvious it does not mean what
it says.  Unless my reading skill really suck.


Also, lets add to my reading comprehension, the Needle:
   `Str(Cool) $needle`

I do not see "D" or "U" anywhere.  Am I missing something?

A test:
     $ p6 'my $x; say "abc".starts-with( $x );'
     Cannot resolve caller starts-with(Str:D: Any:U);
     none of these signatures match: ...

Okay, now it tells me "Any:U" for the needle.  It
is telling me that I sent it a undefined value.  To
me, that is a good troubleshooting hint.  Am I
misreading it?

Now what I would "like to see" (suggestion, not a demand),
is the Haystack complain in a similar fashion.  For instance:

    starts-with's invocant requires a defined value (Str:D)

Have I misread anything?

-T

不十分に書かれている場合、指示は理解するのが困難です

Reply via email to