develooper Front page | perl.perl6.language | Postings from September 2005

Re: \(...)?

Thread Previous | Thread Next
From:
Ingo Blechschmidt
Date:
September 11, 2005 06:35
Subject:
Re: \(...)?
Message ID:
dg1bkb$ad2$1@sea.gmane.org
Hi,

Larry Wall wrote:
> The only questions in my mind are whether Perl 5's \($a,$b) is
> what people expect (it's arguably counterintuitive to newbies),
> and whether there's some other construct that would more naturally
> construct a list of references.  It's not just \« though, since it
> has to *parse* as a list of lvalues.  Maybe a siglet can degenerate to
> that, but there are problems with that approach too.  Unless someone
> can come up with a better proposal, \($a,$b) is the default winner
> on the basis of prior Perl 5 art.

So...:

    \@array;    # Ref to array

    \(@array);  # List of refs to @array's elements, i.e. same as
    map { \$_ } @array;
    # Weird (violating the "parens are only for grouping" rule), but
    # consistent with Perl 5.

Correct?


--Ingo

-- 
Linux, the choice of a GNU | Row, row, row your bits, gently down the
generation on a dual AMD   | stream...  
Athlon!                    | 


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