On Sun, May 31, 2020 at 02:53:45PM +0300, Peter Pentchev wrote:
> On Sat, May 30, 2020 at 04:22:56PM -0700, ToddAndMargo via perl6-users wrote:
> > On 2020-05-30 04:19, Peter Pentchev wrote:
> > > On Fri, May 29, 2020 at 04:36:41PM -0700, ToddAndMargo via perl6-users 
> > > wrote:
> > 
> > > > Hi Peter,
> > > > 
> > > > No doubt it is operating as designed.
> > > > 
> > > > It would be a lot more friendly if "Str:U" was
> > > > changed to "Str:D". Oh please!   Oh Please!
> > > 
> > > Sorry, I don't really understand what you mean.  "Str:U" means
> > > an undefined string - that's what you're calling .starts-with() on.
> > > "Str:D" means a defined string - that's what .starts-with() wants to
> > > operate on.  What do you mean "change Str:U to Str:D" - the error
> > > message says "you invoked it on an undefined string, it wants to be
> > > invoked on a defined string", what do you want to change?
> > > 
> > > Now, if you meant "change Str:U to 'an undefined string'", mmmm, what
> > > I was trying to explain is that the error message is generic, it covers
> > > any wrong calls of functions on any types... it does not really try to
> > > get into what the types are (it cannot, in the general case for any
> > > other type).
> > > 
> > > G'luck,
> > > Peter
> > > 
> > 
> > 
> > Hi Peter,
> 
> Apologies if what I write further down may come off as a little bit
> brusque. It's just that... see at the end, I'm getting a bit of
> deja vu here :)
> 
> [snip]
> > So my beef is when you feed these guys an undefined
> > variable, that they needs to tell you it requires
> > a "defined" variable.  Not a bunch of useless rubbish.
> > For example (useless rubbish):

And also... I thought I mentioned this before. You want a more clear
error message for *one* *single* specific case of a "can't find this
method, did you mean one of these?" error message. I tried to explain
that this error message is one that is displayed in many cases, not only
for "you passed an undefined thing, I want a defined thing"; in my
opinion, it is actually quite helpful in that it actually lists
the candidates in a "did you mean one of these?" style.

You want it to be clear if you pass an undefined value where a defined
value was expected; that would mean that somebody would have to write
the code to make it check whether it is this very specific case and then
that code would have to be maintained for years and years. Tomorrow
you'll say "but can't it give me a more clear message when I pass an
integer and it expected a string?" and the day after tomorrow you'll say
"but can't it give me a more clear message when I pass a string and it
expected a function?".

The error message says "you passed an object of this type, and I can't
find this method for this type; here are a couple of types that have
this method, did you mean one of these?"  It tells you what the types
are, and it doesn't have to have thousands of special cases. It tells
you what the types are.

> >        Cannot resolve caller starts-with(Str:U: Str:D);
> 
> This is not useless rubbish. It says "you tried to call starts-with() on
> something that was an undefined string, and then you passed a defined
> string as a parameter."
> 
> >        none of these signatures match
> > 
> >        (Cool:D: Cool:D $needle, :i(:$ignorecase)!,
> >            :m(:$ignoremark), *%_ --> Bool)
> 
> This is not useless rubbish. It says "you may call starts-with() on
> something that is defined and is of the "Cool" type and pass another
> defined "Cool" thing as a parameter, and then a couple of other
> parameters."
> 
> [snip]
> >        (Str:D: Str:D $needle, :i(:$ignorecase)!,
> >            :m(:$ignoremark), *%_ --> Bool)
> 
> This is not useless rubbish. It says "you may call starts-with() on
> something that is a defined string, and pass another defined string as a
> parameter, and then maybe a couple of other parameters."
> 
> > And I know, I don't get a vote on the matter.
> 
> It's not that you don't get a vote on the matter. It's that there have
> been several times (let's put it that way) when people have told you
> that to read the Raku documentation and to be able to fully use
> the powers of Raku, it would *really*, *really* help you to figure out
> those pesky signature things.
> 
> G'luck,
> Peter
> 
> -- 
> Peter Pentchev  r...@ringlet.net r...@debian.org p...@storpool.com
> PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
> Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13



-- 
-- 
Peter Pentchev  r...@ringlet.net r...@debian.org p...@storpool.com
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13

Attachment: signature.asc
Description: PGP signature

Reply via email to