# HG changeset patch # User Mike Miller # Date 1403062729 14400 # Node ID e6a4fa91a2f157c1d7824adbbe17e75ff988b4e5 # Parent dd34502e5c3c7cdf4cf0b3da793dbf9d02e63421 doc: Clarify order of evaluation of compound assignment expressions * expr.txi: Add descriptive text and example to clarify the actual order of evaluation of assignment expressions that contain another assignment expression. diff -r dd34502e5c3c -r e6a4fa91a2f1 doc/interpreter/expr.txi --- a/doc/interpreter/expr.txi Tue Jun 17 12:04:18 2014 -0400 +++ b/doc/interpreter/expr.txi Tue Jun 17 23:38:49 2014 -0400 @@ -1237,8 +1237,19 @@ @end example @noindent -where @var{op} can be either @code{+}, @code{-}, @code{*}, or @code{/}. -So, the expression +where @var{op} can be either @code{+}, @code{-}, @code{*}, or @code{/}, +as long as @var{expr2} is a simple expression with no side effects. If +@var{expr2} also contains an assignment operator, then this expression +is evaluated as + +@example +@var{temp} = @var{expr2} +@var{expr1} = (@var{expr1}) @var{op} @var{temp} +@end example + +@noindent +where @var{temp} is a placeholder temporary value storing the computed +result of evaluating @var{expr2}. So, the expression @example a *= b+1