Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!funic!santra!santra!ahuttune From: ahuttune@niksula.hut.fi (Ari Juhani Huttunen) Newsgroups: comp.lang.c++ Subject: complex float z = 1.0i2.2; Message-ID: Date: 9 Feb 91 23:55:58 GMT Sender: news@santra.uucp (Cnews - USENET news system) Distribution: comp Organization: Helsinki University of Technology, Finland Lines: 42 While c++ has evolved, it has sometimes done this in a way that is compatible with existing c language features and sometimes not. I think c++ is a language clearly different from c and should not try to imitate every mistake c has done. Others might not agree. The point is, I see c++ as a successor to c and, as such, we will be using it for a long time. This makes it necessary that it be as good as possible and compatibility with c should not prevent this. The changes need not be radical, but should such (radical) changes be deemed necessary, then compatibility with c should not prevent the changes. Now, I don't think these suggestions are going to change anything, but I give them to you anyway. 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.) 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. 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 . 4) Instead of smart pointers, use 'collected class X;'. I have been told that smart pointers can be used for other things besides garbage collection, but I understand this would be their main usage. I'm no expert on garbage collection, but the customization of the garbage collector could perhaps be given to some member functions. If these member functions are not given, the compiler generates ones that use the 'standard' garbage collector. -- ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ I I__I I__I I__I I__I I__I I__I I__I I__I I__I I__I I__I I__I I__I I__I I__I I_ Ari Huttunen A computer is like a house of cards. Not as reliable, but it has an equal number of incompatible parts. _______________________________________________________________________________