ambiguous ?

Jim Giles jlg at lanl.gov
Fri Oct 20 08:38:20 AEST 1989


>From article <1989Oct19.022327.6730 at utzoo.uucp>, by henry at utzoo.uucp (Henry Spencer):
> [...]                             My recollection, admittedly a bit
> dim, is that in ANSI Fortran it is flatly illegal to reference a
> variable with an undefined value.  I don't see the big difference.

If you don't see the difference between something that is illegal
an something which is legal but has no meaning, you just aren't looking.
Besides, C also has the problem of undefined variables and doesn't
detect them for the same reasons.  It's legal but undefined behaviour
that I'm complaining about.

>>... C has _many_
>>more contexts which are _both_ undefined and without efficient ways
>>of overriding the ambiguity.
> 
> Sure there are efficient ways:  avoid depending on the ambiguity.  Oddly

I _don't_ depend on ambiguity.  I _don't_ use language features which
admit of ambiguous behaviour.  Unfortunately, there is no way of using
C efficiently without also using ambiguous features.  (For example, in
the current discussion, the only way to get a reliable evaluation order
for the function arguments is to do redundant assignments in previous
statements.  Most C compilers are _VERY_ bad a optimizing such sequences.)

> enough, this seldom bothers experienced C programmers.  Nobody ever claimed
> C was suitable for beginners.

I am a reasonably experienced C programmer.  I wrote a compiler for my
home system ten years ago just to learn the language.  Yet I am _always_
bothered by the ambiguous features of the language.  I am bothered that
there is no efficient way around them.  You can't even force the evaluation
order of an expression in C.

> Rational arguments are useless against superstition.

Presisely so.  That is why it's so hard to convince C fanatics that
there may be something wrong with their god (the C programming language
that is).

The primary purpose of a programming language is to _unambiguously_
specify the operation of an algorithm.  The extent to which C violates
this is the extent to which C fails in the _purpose_ of a programming
language.  This is a perfectly rational argument.  I suspect you will
ignore it.



More information about the Comp.lang.c mailing list