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

Re: Twigils

Thread Previous | Thread Next
From:
Yuki Kimoto
Date:
August 17, 2021 04:04
Subject:
Re: Twigils
Message ID:
CAExogxOdoO+23-nTTaGqtPUc8TRXREHDR2xMCDAYm2Pgby_sYg@mail.gmail.com
Ovid

2021-8-15 15:19 Ovid via perl5-porters <perl5-porters@perl.org> wrote:

>
> For example, here's a slot with a twigil:
>
>     has $:x;
>
>     method inc ($x) {
>         $:x += $x;
>     }
>
>
>
I still don't see how it will go, however we can think about some
candidates.

Twigil:

     has $:x;

    method inc ($x) {
        $:x += $x;
    }

Variable:

    has $x;

    method inc($dX) {
        $x = $dX;
    }

Hash ref expression:

    has x;

    method inc($x) {
        $self->{x} = $x;
    }

I saw your Twitter.

Do you feel like you're being kicked out of the discussion?

Thread Previous | Thread Next


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