Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mouton.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mouton!ryan From: ryan@mouton.UUCP Newsgroups: net.lang.c Subject: C subscripts Message-ID: <195@mouton.UUCP> Date: Fri, 26-Oct-84 09:37:29 EDT Article-I.D.: mouton.195 Posted: Fri Oct 26 09:37:29 1984 Date-Received: Sat, 27-Oct-84 03:38:04 EDT Organization: AT&T Bell Laboratories, Murray Hill Lines: 44 I hope I am not bringing up and old issue but this discussion about nested comments brings a similiar niggle to mind; one that I am certain should raise an equally fruitful controversy. I am talking about C's arcane subscripting syntax. Who else out there thinks that some_array_name[more][long][names] is actually a good way to do things? Just as we need nested comments, because after all other "great languages" do, I propose that C support "normal" subscripting. Mathematicians have been around longer than C; Fortran too; so, in the name of compatability, which is what the ANSI standard is all about anyway, the compiler SHOULD accept some_array_name[more,long,names] Of course the older, hopefully obsolescent, method will be supported, but it should be discouraged. I would also propose one small, new, preprocessor built-in, SUBTYPE which would be defined OLD or NEW as in #if SUBTYPE == OLD fprintf(stder, "buy a new compiler"); so programmers know what's going on. Not defining SUBTYPE would be considered in an optional subsection to the standard. These details I leave to those who know best. Now, BEFROE the flames start I KNOW the comma operator exists. This is not overloading because subscripts are expressions, not statements. So don't start quoting K&R pg 192 to me. If you're still confused think about it this way: a[x,y,z] saves 20% more disk space than a[x][y][z] and is much easier to type too! respectfully, Tom Ryan p.s. Does anyone know of a good preprocessor macro to convert [a,b,c,...n] into [a][b][c][...][n] for n>1 ?