Path: utzoo!attcan!uunet!munnari!ditmela!smart From: smart@ditmela.oz (Robert Smart) Newsgroups: comp.lang.c++ Subject: Re: Declaration of multi-dimensional arrays. Message-ID: <2304@ditmela.oz> Date: 8 Sep 88 10:20:04 GMT References: <8809032205.aa09007@PARIS.ICS.UCI.EDU> <8166@alice.UUCP> Reply-To: smart@ditmela.oz.au (Robert Smart) Organization: CSIRO, Division of Information Technology, Australia Lines: 24 In article <8166@alice.UUCP> bs@alice.UUCP (Bjarne Stroustrup) writes: > ``subscript argument'' runs into a problem with C. a[1,2,3] is > perfectly legal C and C++ (provided a is of a suitable type). > Here ``a'' is subscripted by the comma expression (1,2,3) whose > value is, of course, 3. The comma expression is a vile infelicity in C. It should be a ";" expression, and thus perfectly compatible with a sequence of expressions within {}s. Then ","s could be reserved for what they are good at: building up a compound object to be the parameter of a procedure or the "index" of a multi-dimensional array or the value of an array or struct (not just in initializations). I realise that the reason for this is that it is incompatible with the syntax of a "for" statement which obviously preceded the invention of the comma expression (which show every sign of being a horrible hack added at the last minute or later). It's too late to fix C, but what happened to rumours of D (or was it P, the next letter in BCPL)? It looks like C++ has been so popular that it has killed any chance of other programming language development in the unix heartland. Bob Smart