Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site houxa.UUCP Path: utzoo!linus!philabs!cmcl2!floyd!vax135!ariel!houti!hogpc!houxm!houxa!9212osd From: 9212osd@houxa.UUCP Newsgroups: net.lang.c Subject: comparing structures, complex data type Message-ID: <254@houxa.UUCP> Date: Mon, 26-Sep-83 13:51:00 EDT Article-I.D.: houxa.254 Posted: Mon Sep 26 13:51:00 1983 Date-Received: Wed, 28-Sep-83 04:08:50 EDT Organization: Bell Labs, Holmdel NJ Lines: 33 A discussion on whether the C compiler should support the comparison of structures has been going on in this group recently. Some said that there were not many applications where this would pay off. Let me give you an example. Consider the absence of the complex data type in C. Most programmers will do this: typedef struct { double re, im } complex; To compare two complex numbers defined as above is not straightforward and comparison of structures in general, would help. But, to add, multiply, divide, etc., etc., complex numbers in C is a pain anyway since you have to define macros (or functions) to do the operations.* The resulting code is hard to read, especially to the scientist or engineer who is used to the FORTRAN or PL/I language. Consequently, the C Programming Language is hard to sell to the hard-core scientist or engineer who just wants to be reassured that a*b is a*b, no matter whether a or b are complex or not. Do I hear any echos? _ * Sure you could also write yappfcn. The one I'm aware of isn't very clean, anyway. _ -- Orlando Sotomayor-Diaz /AT&T Bell Laboratories, Crawfords Corner Road Room HO-3M-325 201-949-1532 Holmdel, New Jersey, 07733 Path: {{{ucbvax,decvax}!}{ihnp4,harpo}!}houxa!9212osd