develooper Front page | perl.perl5.porters | Postings from September 2003

Re: [docpatch] Re: Order of evaluation

Thread Previous | Thread Next
From:
Abigail
Date:
September 8, 2003 23:48
Subject:
Re: [docpatch] Re: Order of evaluation
Message ID:
20030909064806.GD13781@abigail.nl
On Tue, Sep 09, 2003 at 12:30:31AM -0500, david nicol wrote:
> 
> Is the statement correct?  Is the example too complex?

Not until there are regression tests to test this. And until there
is commitment not to change the order of evaluation.

>  diff -u  old/pod/perlop.pod new/pod/perlop.pod
> --- old/pod/perlop.pod	Mon Sep  8 21:15:06 2003
> +++ new/pod/perlop.pod	Mon Sep  8 22:01:38 2003
> @@ -404,6 +404,17 @@
>  
>  Using "or" for assignment is unlikely to do what you want; see below.
>  
> +=head2 Evaluation order
> +
> +All evaluated operands are evaluated left to right as
> +they appear, regardless of associative grouping.
> +
> +    @_ = qw(g f e d c b a);
> +    print join(",",
> +      shift().shift(), shift(),
> +      sort shift().shift(), shift().shift()); # prints "gf,e,ba,dc"
> +
> +


Abigail

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