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 25, 2022 15:56
Subject:
Re: Things you can't do in a signatured sub
Message ID:
20220125155628.0d0c5089@shy.leonerd.org.uk
On Tue, 25 Jan 2022 07:01:04 +0000 (UTC)
Ovid via perl5-porters <perl5-porters@perl.org> wrote:

> > On Monday, 24 January 2022, 23:32:04 CET, Paul "LeoNerd" Evans
> > <leonerd@leonerd.org.uk> wrote:
> > 
> > 
> > $ 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.  
> 
> I'm sold! (though I'd prefer a modifier instead of a keyword)

Perhaps so, though I don't think a CPAN module would be able to provide
it in that syntax, which is why I didn't try. Perhaps a future thought
of a core implementation would indeed write it `sub NAME :multi ...`

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