Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!randy From: randy@utcsri.UUCP (Randall S. Becker) Newsgroups: net.lang.c Subject: Re: unary + Message-ID: <2591@utcsri.UUCP> Date: Sat, 19-Apr-86 19:16:44 EST Article-I.D.: utcsri.2591 Posted: Sat Apr 19 19:16:44 1986 Date-Received: Sat, 19-Apr-86 19:20:02 EST References: <2323@brl-smoke.ARPA> <687@bentley.UUCP> <1245@mmintl.UUCP> Reply-To: randy@utcsri.UUCP (Randall S. Becker) Organization: CSRI, University of Toronto Lines: 35 Summary: In article <1245@mmintl.UUCP> franka@mmintl.UUCP (Frank Adams) writes: > >In article <687@bentley.UUCP> kwh@bentley.UUCP writes: >>In article <2323@brl-smoke.ARPA> HARGED%ti-eg.csnet@CSNET-RELAY.ARPA writes: >>>Folks, no two ways about it: "a + +(b + c)" looks very strange (it looks >>>like a typographical error), particularly when it is *required* to >>>accomplish what most people intuitively assume "a + (b + c)" will >>>accomplish. From a human factors standpoint, this proposal is a >>>disaster. > >Let me repeat my suggestion that "a + [b + c]" be used for this purpose. >It isn't *obvious* what it is intended to mean differently from "a + (b + c)", >but it at least doesn't look like a typographical error. Use of brackets >of arbitrary shape or size has a long mathematical tradition. > Forgive me for asking, but what is meant by a + +(b + c)? Common interpretations: a + abs(b + c) (not likely) a + (b + c) (likely, in my opinion) Now, if unary plus is equivalent to the generic abs() operator then why not use abs()? I know, C doesn't have generics. I would argue that the meaning is exactly the second case. What does + ( -1 ) mean? -1. How about - + - 1? 1. Obviously, +1 had better be 1. The use of unary '+' as a no sign change operator is the accepted definition in some languages developed at the University of Toronto. Randy -- Randall S. Becker Usenet: ..!utcsri!randy CSNET: randy@toronto