fabs(x) vs. (x) < 0 ? -(x) : (x)

Henry Spencer henry at utzoo.UUCP
Wed Feb 11 06:38:17 AEST 1987


> The absence of this ability (in suitably C-like syntax) to create explicit
> temporaries in C expressions explains why getc() and putc() are allowed
> to evaluate their parameters more than once.
> 
> Question: do not the ANSI committee find this uncomfortable too?
> Is the absence of suitable concrete syntax the justification?

I conjecture that most members of the ANSI committee don't find this
particularly uncomfortable, since old implementations which evaluate the
arguments more than once will be around for a long time and hence everyone
has to be cautious anyway.

The reason for not doing anything about it probably has nothing to do with
the lack of syntax -- anyone can invent syntax -- but with the lack of clear
need and the absence of substantial real experience with the idea.  Although
this rule sometimes seems more honored in the breach than in the observance,
X3J11 really is supposed to be standardizing existing ideas rather than
inventing new ones.
-- 
Legalize			Henry Spencer @ U of Toronto Zoology
freedom!			{allegra,ihnp4,decvax,pyramid}!utzoo!henry



More information about the Comp.lang.c mailing list