develooper Front page | perl.perl5.porters | Postings from November 2017

Re: square signatures

Thread Previous | Thread Next
Father Chrysostomos
November 13, 2017 20:37
Re: square signatures
Message ID:
> Under this arrangement we would see things like:
>     sub mul ($$) [$x, $y] { $x * $y }       # prototype and signature

I like this idea.

At first glance, though, I wonder what that array is doing there.
Since anonymous arrays are very common, and file globbing is rela-
tively rare, perhaps this would be a better syntax:

    sub mul ($$) <$x, $y> { $x * $y }

Also, you never see file globbing that looks like <$a, $b>, so it is
hard to confuse them.

This should make code more skimmable.

> Let the opinions flow.

I will just add that I fully support putting attributes before signa-
tures, the way they used to be in 5.20.

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