On Fri, Apr 15, 2022 at 4:15 PM yary <not....@gmail.com> wrote:
>
> Here's how I ended up handling input arg validation, with meaningful error 
> messages, as part of a Perl Weekly Challenge a couple years ago. It looks 
> almost the same as Luca's original, except mine uses "die" instead of "warn", 
> which means it won't attempt to continue once it encounters a bad arg.

Interesting, but I used `warn` because I want to display all things
that are not correct at once. In the test case I submitted there is no
great difference in using warn instead of die, since the program
should stop in any case, but if you have a bunch of named arguments I
would like to see all `warn` messages at once, so I have a chance to
fix all my invocation line at once.

> I'm starting to think Luca's found a regression, since using the explicit 
> variable name instead of the topic fixes the issue. That seems wrong.

I don't know, in the beginning I thought there was a problem with the
language specifcation, I mean, something has changed in the `wherre`
and topic usage. However, hoping to improve our knowledge or the
implementation, I've submitted an issue here
<https://github.com/rakudo/rakudo/issues/4878>.

Thanks,
Luca

Reply via email to