reaction to Variable Length Array Proposal <9302100816.AA04241aredvax.mimosa.com>

uunet!netcom.com!segfault!rfg uunet!netcom.com!segfault!rfg
Wed Feb 10 02:21:18 PST 1993



I'd like to thank D. Hugh Redelmeier for his posting regarding VLAs.

In a previous posting of my own, I made some (admittedly) rather vague
statements to the effect that "backward scoping" would cause horrendous
problems.  I did not elaborate further, because the whole thing seemed
just too painful to dwell on.

Fortunately, Mr. Redelmeier saved me from having to do the thinking
necessary to create a really ugly example to illustrate some of the
problems which could arise from this "backward scoping" notion.

I particularly appreciated this one:
  
	/* is this specified? */
	void f(int a[n], void (*g)(int a[n/*??*/], int n), int n);

But I don't think that is nearly the end of the matter either.  Consider:
  
	/* is this specified? */
	void f(int a[n], int n, void (*g)(int a[n/*??*/], int n));

Or better yet:
  
	/* is this specified? */
	void f(int a[n], int n, void (*g)(void (*fp) (int a[n/*??*/]), int n));

Now I feel completely confident that Tom M. is capable of devising some
disambiguating rule (or rules) which will render the meaning "well defined"
in each of these cases, but that's not really the point.  The point is
that the scoping rules of C are simple *not* just to make compilers happy,
but also to make code generally more readable FOR HUMAN BEINGS.

The bottom line is that the current overriding scoping rules of C are good,
simple to understand, and simple to implement.  The only argument I've
seen advanced so far that these time-tested rules ought to be broken is
that breaking them would allow "numerical C" to cater just slightly more
to a few crybaby FORTRAN programmers who (for some reason I can't fathom)
want to switch languages but do not wish to alter (by so much as one iota)
their mental model of how a few of their favorite non-standard library
functions are called.

If adapting in this one minor way to the differences between C and FORTRAN
is really going to cause these FORTRAN devotees to become so distraught
that they won't be able to get their work done anymore... well, perhaps
they had best just stick with FORTRAN and forget about C.  If they know
FORTRAN, love FORTRAN, and can't live without FORTRAN, I say let them
have FORTRAN.  Let them have all the FORTRAN they want.  But please don't
let them force me to write FORTRAN code and please don't let them force
me to write FORTRAN compilers (in the guise of "extended C").

'nuff said.


// Ronald F. Guilmette
//    domain address:	rfgasegfault.uucp
//    uucp address:	...!uunet!netcom.com!segfault!rfg



More information about the Numeric-interest mailing list