X3J11 thoughts (standardization)

Dick Dunn rcd at opus.UUCP
Thu Aug 30 04:42:45 AEST 1984


>Consider the analysis that a compiler would have to perform
>to deduce that subprograms called within a for loop did not
>change a non-locally declared control variable (by "side effect").
>Speaking as a user, I would rather have a restriction that has a
>chance of being implemeted according to the standard than make
>a requirement that few compilers are ever likely to comply with.

I'll try to state my case again:  The (arguably detrimental) change to the
language made during standardization was one which required that the
control variable of a "for" be a local variable of the procedure in which
the "for" occurs.  It is this change (and NOT the constraint on changing
the variable within the loop) which was significant to users and which
broke some programs.

The questions of (a) where the control variable is declared and (b) whether
a modifying reference to it might exist within the loop are separate (but
slightly related) questions.

Of course, all of this is still somewhat peripheral; I intended it as an
example of the standardization process making changes in the language being
standardized.

>As a member of the British Standards Institute committee
>that drafted the BSI/ISO Pascal standard  (the ANSI standard
>being essentially identical to the ISO level 0 subset), I can
>assure him that the restriction of control variables to be local
>variables is due neither to malice, nor to stupidity.

I didn't apply the malice/stupidity analysis.  If you want to interpret my
.signature as part of the content of the article, that's your problem.  If
you would like to avoid doing so, I'll give you a clue:  I (as most people)
do not sign articles in the middle.
-- 
Dick Dunn	{hao,ucbvax,allegra}!nbires!rcd		(303)444-5710 x3086
   ...I'm not cynical - just experienced.



More information about the Comp.lang.c mailing list