develooper Front page | perl.perl6.users | Postings from April 2022

Re: checking MAIN arguments

Thread Previous
Luca Ferrari
April 28, 2022 07:04
Re: checking MAIN arguments
Message ID:
On Wed, Apr 27, 2022 at 7:29 PM yary <> wrote:
> It's like the "where" clause has its own signature-like list of types it will accept. When the where clause uses the default topic "$_" then that topic has no constraint, and MAIN can probe if "--dir=something" should be interpreted as a flag Bool::True or if it should be the string "something". When the "where" clause has only $dir in the body, the optimizer can specialize it to only take Str, and then MAIN doesn't need to probe the Bool::True case.

Sounds a good guess!
What I am a little surprised here is that it seems to me this
behavior, that has changed during time, is not well documented, at
least according to me.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About