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:
Paul "LeoNerd" Evans
Date:
January 24, 2022 22:31
Subject:
Re: Things you can't do in a signatured sub
Message ID:
20220124223133.76884a15@shy.leonerd.org.uk
On Mon, 24 Jan 2022 20:09:24 +0000 (UTC)
Ovid <curtis_ovid_poe@yahoo.com> wrote:

> What do we do with this?
> 
>     sub max :multi(@args) {...}
>     sub max :multi(%args) {...}
> 
> Because arrays and hashes flatten into a list, unless @args has an
> odd number of elements, we can't disambiguate them, can we?

$ perl -Mexperimental=signatures -MSyntax::Keyword::MultiSub
multi sub max (@args) {...}
multi sub max (%args) {...}
Already have a slurpy function body for multi sub max at - line 2.


Compiletime error.

-- 
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