Article View: net.lang.c
Article #9609Re: Expression Sequencing Query
From: Joshua W. Knight
Date: Sat, 18 Oct 1986 04:10
Date: Sat, 18 Oct 1986 04:10
19 lines
1259 bytes
1259 bytes
There have been lots of lamentations about C not providing a way to
force evaluation order. The original subject (with multiple "side
effect" assignments to the same variable) isn't really the issue here.
One legitimate concern is truncation and such in numerical calculations.
The ANSI C draft standard provides the unary plus operator for coercing
evaluation order. Thus
a = +(b + c) + +(d) ;
should force the sum of b+c to be calculated and added to d. This is
probably less pleasing to the eye but, as has been pointed out before,
parentheses already have a meaning in C, and it is explicitly NOT one
that forces order of evaluation.
Of course I speak only for myself, not my employer.
Josh Knight
IBM T.J. Watson Research Center
josh@ibm.com, josh@yktvmh.BITNET
Technical Details
Message-ID:
<4711@brl-smoke.ARPA>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!brl-adm!brl-smoke!smoke!JOSH@ibm-sj.ARPAShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!brl-adm!brl-smoke!smoke!JOSH@ibm-sj.ARPA From: JOSH@ibm-sj.ARPA (Joshua W. Knight) Newsgroups: net.lang.c Subject: Re: Expression Sequencing Query Message-ID: <4711@brl-smoke.ARPA> Date: Sat, 18-Oct-86 00:10:47 EDT Article-I.D.: brl-smok.4711 Posted: Sat Oct 18 00:10:47 1986 Date-Received: Tue, 21-Oct-86 22:23:27 EDT Sender: news@brl-smoke.ARPA Lines: 19