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

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

Thread Previous | Thread Next
From:
Ovid via perl5-porters
Date:
January 21, 2022 17:16
Subject:
Re: Things you can't do in a signatured sub
Message ID:
798026949.442185.1642785356419@mail.yahoo.com
On Friday, 21 January 2022, 18:11:27 CET, Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> 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`.

Best,
Ovid
-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk
      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About