Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!ssc-vax!cxsea!blm From: blm@cxsea.UUCP (Brian Matthews) Newsgroups: comp.lang.c Subject: Re: New Features: ++(expr) Message-ID: <2354@cxsea.UUCP> Date: 11 Feb 88 16:15:40 GMT References: <386@osupyr.UUCP> Reply-To: blm@cxsea.UUCP (Brian Matthews) Organization: Computer X Inc. Lines: 18 Don Comeau (ddc@osupyr.UUCP) writes: |Since everyone else is suggesting their addtion to C, here is one I |think would be useful. Why are ++ and -- still limited to lvalues? I |think ++expresion should be an expression which has the value |expression+1. |Are there any good reason why this hasn't been done? Yes. ++ and -- have the side effect of incrementing or decrementing the lvalue they're applied to, so they have to be applied to lvalues. How does one increment x + y (as in ++(x+y)) or m + 4 (as in ++(m+4))? If you want the value of one more than an expression and don't want the increment side effect, that's easy to do in C also: expression + 1 -- Brian L. Matthews "A power tool is not a toy. ...{mnetor,uw-beaver!ssc-vax}!cxsea!blm Unix is a power tool." +1 206 251 6811 Computer X Inc. - a division of Motorola New Enterprises