Re: sequence points in subexpressions
- From: Kaz Kylheku <kkylheku@xxxxxxxxx>
- Date: Tue, 15 Dec 2009 23:16:48 +0000 (UTC)
On 2009-12-14, pete <pfiland@xxxxxxxxxxxxxx> wrote:
Beej Jorgensen wrote:
o For the value computation of (i,i++,i) to be complete, i++'s side
effects must be complete.
I disagree.
I know that the value of (i,i++,i) is one greater
than the original value of (i).
I computed that without accomplishing any side effects.
You /must/ be trolling.
Computing the value of (i, i++, i) is /mathematically/ impossible without
modelling the side effect of i++, and reconciliation thereof by the comma
operator's sequence point.
Without the help of that sequence point, the final rightmost i does not
reliably refer to the incremented value.
You cannot reduce the expression to a stable value without taking into account
the sequence points and modeling them faithfully in your evaluation.
In your evaluation model, you must instantiate a representation of the object
i, and then perform the side effect upon it. There are no magic shortcuts.
.
- Follow-Ups:
- Re: sequence points in subexpressions
- From: Johannes Schaub (litb)
- Re: sequence points in subexpressions
- From: Richard
- Re: sequence points in subexpressions
- References:
- sequence points in subexpressions
- From: amit.codename13@xxxxxxxxx
- Re: sequence points in subexpressions
- From: Beej Jorgensen
- Re: sequence points in subexpressions
- From: pete
- sequence points in subexpressions
- Prev by Date: Re: Fn Defn Style
- Next by Date: Re: Advanced data structures
- Previous by thread: Re: sequence points in subexpressions
- Next by thread: Re: sequence points in subexpressions
- Index(es):
Relevant Pages
|