Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!hsi!mfci!karzes From: karzes@mfci.UUCP (Tom Karzes) Newsgroups: comp.lang.c Subject: Re: syntax for unary assignment operators (was Re: C history question) Keywords: C design, XOR Message-ID: <1032@m3.mfci.UUCP> Date: 18 Sep 89 19:49:25 GMT References: <575@calmasd.Prime.COM> <1687@sunset.MATH.UCLA.EDU> <174@cpsolv.UUCP> <1989Sep17.150504.16643@jarvis.csri.toronto.edu> Sender: karzes@mfci.UUCP Reply-To: karzes@mfci.UUCP (Tom Karzes) Organization: Multiflow Computer Inc., Branford Ct. 06405 Lines: 28 In article <1989Sep17.150504.16643@jarvis.csri.toronto.edu> flaps@dgp.toronto.edu (Alan J Rosenthal) writes: >A somewhat consistent but fairly bizarre syntax would be > x -=; > >The analogy to x -= y is that > x fn= y; >expands to > x = fn(x, y); >so > x fn=; >expands to > x = fn(x); The problem with this is that you would like it to have the same precedence as ++ and --. This causes the following: a -= * b to be parsed as: (a -=) * b rather than: a -= (* b) which is the current correct parse (and which should remain the correct parse). You'd have to introduce a new operator to make this work reasonably.