Path: utzoo!utgpu!water!watmath!clyde!bellcore!faline!ulysses!allegra!princeton!udel!gatech!bloom-beacon!husc6!cca!g-rh From: g-rh@cca.UUCP Newsgroups: comp.lang.c Subject: Re: min and max Summary: The FORTRAN solution is probably right. Message-ID: <23626@cca.CCA.COM> Date: 24 Jan 88 13:48:20 GMT References: <11182@brl-adm.ARPA> <2197@haddock.ISC.COM> <518@cresswell.quintus.UUCP> <2254@haddock.ISC.COM> <515@viper.Lynx.MN.Org> <2336@haddock.ISC.COM> <2682@mmintl.UUCP> Reply-To: g-rh@CCA.CCA.COM.UUCP (Richard Harter) Organization: Computer Corp. of America, Cambridge, MA Lines: 23 Posted: Sun Jan 24 08:48:20 1988 One more time around on this very dead horse (no wonder we don't get anywhere). FORTRAN has the notion of routines which are defined as part of the language. The advantage is that the compiler can implement these routines as convenient. Also one can use the general notion of a function rather than introducing still more obscure symbols. Suppose that min(a,b) and max(a,b) are defined with the following properties: a and b must be of the same type; the result is of the same type as a and b; and if a and b are the same expression, only one evaluation is done. Note that these typing rules rule out user supplied substitute functions -- a user written function wouldn't know what types to use. It seems to me that C has about reached the limits of using special symbols for operators; if new operators are warranted, the function notation might be better. Just a thought. -- In the fields of Hell where the grass grows high Are the graves of dreams allowed to die. Richard Harter, SMDS Inc.