develooper Front page | perl.perl5.porters | Postings from June 2022

Re: Signature feature request (pre-rfc?)

Thread Previous
June 7, 2022 07:02
Re: Signature feature request (pre-rfc?)
Message ID:
On Mon, Jun 6, 2022 at 11:16 PM Dan Book <> wrote:

> I don't think we should - there are a lot of differences between "my
> declaration" and "signature" syntax, and the syntax for doing this in a
> signature is "$". But relevant to this, LeoNerd has previously mused over
> an assignment operator that uses the signature syntax.

I would be delighted to see something like this. As much as possible, I
like to see similar concepts use similar syntax.

            my ( $foo, undef ) = some_func();
    sub wibble ( $foo, undef ) { ... }

That's much more intuitive when we can *guess* what the syntax is. So
either allow the undef in the signature declaration or allow the $ in
the variable declaration (I don't know if the latter is even possible,
thanks to the $) variable).

            my ( $foo, $ ) = some_func();
    sub wibble ( $foo, $ ) { ... }

Curtis "Ovid" Poe
CTO, All Around the World
World-class software development and consulting

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