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

Re: Signature feature request (pre-rfc?)

Thread Previous
From:
Ovid
Date:
June 7, 2022 07:02
Subject:
Re: Signature feature request (pre-rfc?)
Message ID:
CA+M4CHvBsfnYCYDYsda1vd_ufxK_yPQ25NP5UeHAZhS3h=7MTA@mail.gmail.com
On Mon, Jun 6, 2022 at 11:16 PM Dan Book <grinnz@gmail.com> 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, $ ) { ... }

Best,
--
Curtis "Ovid" Poe
CTO, All Around the World
World-class software development and consulting
https://allaroundtheworld.fr/

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About