Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!sol.ctr.columbia.edu!emory!att!att!westmark!mole-end!mat From: mat@mole-end.UUCP (Mark A Terribile) Newsgroups: comp.lang.c++ Subject: Re: complex float z = 1.0i2.2; Summary: A dangerous free radical? Message-ID: <483@mole-end.UUCP> Date: 14 Feb 91 04:41:01 GMT References: Distribution: comp Organization: mole-end--private system. admin: mole-end!newtnews Lines: 57 > ... I see c++ as a successor to c and ... we will be using it for a long > time. [it must] be as good as possible and compatibility with c should not > prevent this. ... but should such (radical) changes be deemed necessary, > then compatibility with c should not prevent the changes. Yes, well, let's all deem together ... > 1) I don't think comma-operator is necessary and it should be thrown out of > the language. After that you could change multi-dimensional array referencing > to array[x,y,z];. (How can you implement multi-dimensional arrays of > your own classes using the current array[x][y][z] syntax? I suppose there > is a way, but I can't think of a good one.) Oh, I think it's necessary. for( i = 0, j = last, d = 0 ; j >= 0 ; i++, j--, d += w( k ) ) { : : if( . . . ) { : continue; } : : } If those three expressions in the increment-part of the for( ; ; ) are the essential part of the step from one pass of the loop to the next, and if you take the comma operator out of the language, you also take away the ability to use the continue . That puts us back in Pascal-Land, where I really don't want to be. I've written about Pascal's circumlocutions, wherein one branch of an if-then-else is devoted to the problem to be solved and the other branch is devoted to setting up flags that will cause the loop to terminate properly, and just writing about it is unpleasant. Actually writing it is worse. > 2) Array indexing such as int array[2..5]; should be possible. There would > not have to be runtime checking, but the capability to change the lower > bound is convenient in many situations. first(array) and last(array) would > return the lower and upper bound respectively. Hey, this is C++. Program it! (This will become a little neater when we get templates.) > 3) Complex number are a basic data type and should be included in the > language. There could well be data types such as complex int z, or > complex float z. Some examples of complex number constants: 1.5i2 that > means 1.5 + 2*i (i = imaginary), 0.5e-1i.45 . I recognize that complex numbers have been written for C++ about one and one half times for each C++ programmer, but ANSI could do a real service by calling for a good version and one without significant run-time penalty. -- (This man's opinions are his own.) From mole-end Mark Terribile