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

Re: [perl #133301] Evalulation order during concat changed

Thread Previous | Thread Next
From:
Sawyer X
Date:
August 24, 2018 13:59
Subject:
Re: [perl #133301] Evalulation order during concat changed
Message ID:
12853_1535119159_5B800F37_12853_32_1_b90f2178-369e-8174-37ad-d3ad0a964e51@gmail.com


On 08/24/2018 11:38 AM, Dave Mitchell wrote:
> On Thu, Aug 23, 2018 at 02:39:08PM -0500, David Nicol wrote:
>>  Binary C<"."> concatenates two strings.
>> +
>> +A series of terms joined by  C<"."> operators are evaluated prior to
>> +all getting concatenated in a single operation.  Prior to version 5.28,
>> +aliasing issues only affected the value of the first term in a series
>> +of concatenations, as the left side of the second and later operations
>> +was the intermediate result of the previous binary operation.
> What this documentation patch does, is change what was undefined
> behaviour (or at least that was my feeling of where the discussion ended
> up) into defined behaviour, which we are now committed to support.
>
> I don't want the internal (and possibly changeable) details of an
> optimisation to become a straight jacket.
>
> [...]
>
> In conclusion, I don't think the pod for the concatenation op should
> specify anything about order. I think that we should however fix the text
> recently added to perlop which implied a guarantee about the ordering of
> arg evaluation in general which we shouldn't have given.

The documentation could specify the lack of guarantee. That would remove
any possible ambiguity about whether it's defined or not.

"The order in which concatenated expressions is undefined and should not
be relied upon."

(Or some better phrasing.)

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