develooper Front page | perl.perl5.porters | Postings from January 2022

Re: Things you can't do in a signatured sub

Thread Previous | Thread Next
Ovid via perl5-porters
January 21, 2022 17:16
Re: Things you can't do in a signatured sub
Message ID:
On Friday, 21 January 2022, 18:11:27 CET, Paul "LeoNerd" Evans <> wrote:

> Wellsure but now you've just moved the goalpost - how to distinguish
>  foo(unknown);
>  foo();

I would suggest that if someone passed in `unknown` without knowing what they were passing in and why, that would be a bug :)

But I also think the semantics of `foo(unknown)` are fine because a subroutine checking for unknown values would already be handling them correctly, rather than having the unexpected coercions of `undef`.

Paul "LeoNerd" Evans
      |  |

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