Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!pt.cs.cmu.edu!ius1.cs.cmu.edu!edw From: edw@ius1.cs.cmu.edu (Eddie Wyatt) Newsgroups: comp.lang.c Subject: Re: Complex type ? Message-ID: <1013@ius1.cs.cmu.edu> Date: Sun, 10-May-87 15:43:47 EDT Article-I.D.: ius1.1013 Posted: Sun May 10 15:43:47 1987 Date-Received: Sun, 10-May-87 19:09:20 EDT References: <7264@brl-adm.ARPA> <734@sdchema.sdchem.UUCP> Organization: Carnegie-Mellon University, CS/RI Lines: 65 In article <734@sdchema.sdchem.UUCP>, tps@sdchem.UUCP (Tom Stockfisch) writes: > This only solves the problem for the type "complex". What about vectors > and matrices and (use your imagination)? What C really needs is the > operator-overloading facility already available in C++. With this you > can re-define + and * for any new data type you please. Even if you > use this only for type complex, its still a gain because you can use > your favorite complex operation algorithms. > > What we number-crunchers really need to do is convince the X3J11 committee > to borrow just this one more idea (I promise, this is the absolute last one, > but in my opinion the most important) from C++ and put it in the new > standard. > > > > || Tom Stockfisch, UCSD Chemistry tps%chem@sdcsvax.ucsd.edu > or sdcsvax!sdchem!tps No, what C really needs is not operator-overloading. There already exist a class of languages that provide such facilities, use them instead. What you're sugguesting is to change C into a data abstact language, which is not the intended purpose. If you want a data abstract language that looks like C use C++, just like you said. Listen here people, C is not Fortrash, Pascal, Ada or Lisp, it is C, a simple procedural oriented language that allows one to do some very powerful and sometimes unkosher things. I view the language as a modified form of assemble language. It gives you the high level control constructs of block structured languages, yet allows you to get at some of the low level operations of the machine such as the bit operations. By the way, in the current project that I am working on, if I had had a say in the language we are using, I would have choosen a data abstract language, posibly C++. I find it the case that I need routines for queues and hash tables for many different data objects. I have written generic queue and hash table routines but I have some very unkosher code in one place where I do take advantage of sizeof(int) == sizeof(char *) on the machines that I work on. I should sometime go back and change that. Anyway, back to the original topic of complex types. If the complex number is added to the language should the real and imaginary parts be represented as doubles or singles. Or should there be two types of complex numbers long complex and the complex? What are the semantics of complex++ and complex--? Also should any semantic meaning be given to complex1 < complex2? I personal have nothing against adding the complex type to the language. But if it is added, I at least hope that all the language semantic issues are WELL thought out before implimenting them. Eddie Wyatt e-mail edw@ius2.cs.cmu.edu -- Eddie Wyatt They say there are strangers, who threaten us In our immigrants and infidels They say there is strangeness, too dangerous In our theatres and bookstore shelves Those who know what's best for us- Must rise and save us from ourselves Quick to judge ... Quick to anger ... Slow to understand... Ignorance and prejudice and fear [all] Walk hand in hand. - RUSH