develooper Front page | perl.perl5.porters | Postings from July 2009

(Tired? Dead?) argument opposed to := for Perl 5 aliasing syntax

Thread Next
From:
David Nicol
Date:
July 15, 2009 14:06
Subject:
(Tired? Dead?) argument opposed to := for Perl 5 aliasing syntax
Message ID:
934f64a20907151406w5b499c22yaa545e61add1c25@mail.gmail.com
On Wed, Jul 15, 2009 at 12:13 PM, Eric Brine<ikegami@adaelis.com> wrote:
> The only between that and my original post is that I combined
>
>           my $copy = $buf;
>           $buf := $copy;
>
> into
>
>           $buf := my $copy = $buf;

so is := clearer than "lvalue reference syntax?"  In LRS, that would be

     my $copy = $buf;
     \$buf = \$copy;
into
    \$buf = \(my $copy = $buf);

I don't know how small of a minority I am in, but LRS doesn't require a new
syntax signifier that looks like other things.  When I see "$buf := $copy"
my inclination is to track down a recent reference card and see what the
colon operator does, because I mentally unfold that construction to "$buf =
$buf : $copy" which presumably means to add whatever attribute is
represented by $copy to the $buf variable.

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