develooper Front page | perl.perl5.porters | Postings from February 2021

Re: De-experimentalising "signatures"

Thread Previous | Thread Next
Paul "LeoNerd" Evans
February 10, 2021 12:25
Re: De-experimentalising "signatures"
Message ID:
On Wed, 10 Feb 2021 16:28:34 +0900
Yuki Kimoto <> wrote:

> > Honestly, the arity checking is an often-requested feature, and one
> >  
> that most signature-users find natural and welcome.
> Sorry,
> When you say most,
> My existence doesn't seem to be included there.

"Sweeping judgements are, in general, usually correct" ;)

Given any statement about a large collection of people, there'll almost
always be some people who don't fit it. And in the field of computer
language design, for any given feature, there will always be some
people who love it and some who hate it. 

> I like the idea that Perl has no constraints by default.
> I also want the signature to be designed to be unconstrained by
> default.
> That seems like javascript
> function func(foo, bar) { }

Now I admit I don't know JavaScript, but it would surprise me if you
didn't get any sort of runtime error when trying to call either of


> "sub_args" may be more appropriate name than the name "signatures".
> I agree that some users think they need an arity check and type
> checking.

I think the vast swathe of CPAN modules where people try to hack on all
sorts of such concepts into the language suggests that there are lots
of users who think that. A few that I recall offhand:

Admittedly some of these are more cumbersome and less expressive to
actually use than would be liked, because they are constrained by
having to appear like currently-valid Perl syntax.

It is our job as the architects and maintainers of the language itself
to regularly take a look out into the real world, see what things
people are actually doing, and provide them better tools for doing that.

Paul "LeoNerd" Evans      |  |

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