Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!dgp.toronto.edu!flaps From: flaps@dgp.toronto.edu (Alan J Rosenthal) Newsgroups: comp.lang.c Subject: syntax for unary assignment operators (was Re: C history question) Keywords: C design, XOR Message-ID: <1989Sep17.150504.16643@jarvis.csri.toronto.edu> Date: 17 Sep 89 19:05:04 GMT References: <575@calmasd.Prime.COM> <1687@sunset.MATH.UCLA.EDU> <174@cpsolv.UUCP> Lines: 20 rhg@cpsolv.UUCP (Richard H. Gumpertz) writes: >As long as we are discussing missing "assignment" operators, you might ponder >the lack of unary assignment operators. Why should I have to say X = -X or >X = ~X? Why not have unary assignment operators (ala ++ and --) for negation >and complement? I suppose a new syntax would have to be invented, but it >might be useful at times. 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); ajr