Why is the specification of subroutine signatures so complicated?

As a general Perl user who uses Perl for text processing on Linux, I have a simple question.

Why is the specification of subroutine signatures so complicated?

Jumbo Signatures extensions discussion

The most common criticism of Perl is that it cannot read Perl grammar.

If Perl grammar evolves in an easy-to-understand direction, you are welcome.

If you are going to increase the complexity blame for Perl, think a little more.

Is this feature really useful for users who want to do text processing on Linux/Unix?

A single language cannot satisfy every need.

I have not yet seen what purpose Perl is aiming for.

4 Comments

Yeah, the current proposal is very overcomplicated. For the type constraints and coercions, I suggested dropping coercions altogether and simplifying constraints to just one new keyword. Coercions would be more clearly written in the body of the sub (and this would make interaction with aliasing and read-only parameters less confusing), and the one small bit of syntax that I proposed is able to cover the use cases for every other feature of Dave's type constraint proposal.

Other parts of the proposal, I haven't looked at in as much detail.

Because there are many different ideas, and thus expectations, of what features signatures need to have, else we risk simply changing the "Perl doesn't have signatures" criticism to "Perl's signatures are useless" when we don't fulfill someone's needs.

Leave a comment

About Yuki Kimoto

user-pic I'm Perl Programmer. I LOVE Perl. I want to contribute Perl community and Perl users.