Conformant Arrays in C

Richard A. O'Keefe ok at quintus.UUCP
Fri Feb 26 12:11:39 AEST 1988


In article <1988Feb24.165307.4938 at light.uucp>, bvs at light.uucp (Bakul Shah) writes:
> Multi-dimensional arrays are a useful feature and David Hough / Richard
> O'Keefe's proposal of conformant arrays is usable & implementable.  But
...
> Such things are best left for C++.
...
> If they are added to C, C++ will be forced to carry them (thereby
> introducing an unneeded hack)  OR, C++ will *not* be upward compatible
> to C.  Since conformant arrays do not exist in C today, only new code
> will use this feature (if added).  Why not use C++ or Chris Torek's idea
> for new code?

I am sorry to blaspheme against anyone's religion, but IHMO, C++ itself
is an unneeded hack.  Well, add a smiley to "unneeded", but "hack" I am
serious about.  C++ is the Fortran 8X of object-oriented languages.
X3J3, in trying to put together a language with all sorts of things which
are in themselves good, yet which contains Fortran 77 as a subset, have
created a monster.  C++ is just such a monster.  The things that Stroustrup
added to C are in themselves fine things, the trouble was that more things
should have been left out.  If C++ is not upwards compatible with C, so
much the better, and about time too!  There is something distinctly odd
about letting the C++ tail wag the C dog.

C is not the only language in the world.  It would be so nice to have
intercallability between ANSI C and ISO Pascal.  It is particularly
important not to commit to a particular device (such as Chris Torek's
idea) so that an implementor can provide something which can be connected
in a sensible fashion to Pascal or Turing or PL/I or even (via a wee bit of
macro expansion) to Fortran.  If I go to the trouble of coding a simplex
algorithm in C, and run it on an IBM mainframe, I would like the C vendor
to have been able to select an implementation of conformant array parameters
which is compatible with PL/I.  Or if I find that there is a better one
already there in PL/I, I don't want to have written my program using
edge-vectors so that I am *guaranteed* incompatibility with everything in
sight!

It is only too credible that conformant array parameters may not be the
best way of achieving the goals of
  o minimal change to the language and implementation
  o making it straightforward to write functions with multidimensional
    array parameters
  o avoiding over-specification, so that intercallability with other
    language is not impaired more than we can help
But it is CERTAIN that Bakul Shah's suggested alternatives
> Why not use C++ or Chris Torek's idea for new code?
do not meet those goals.



More information about the Comp.lang.c mailing list