Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!ur-tut!sunybcs!boulder!hao!noao!mcdsun!sunburn!gtx!al From: al@gtx.com (0732) Newsgroups: comp.lang.c Subject: Re: New Features: ++(expr) Message-ID: <572@gtx.com> Date: 11 Feb 88 19:19:17 GMT References: <386@osupyr.UUCP> Reply-To: al@gtx.UUCP (Al Filipski 839-0732) Organization: GTX Corporation, Phoenix Lines: 29 In article <386@osupyr.UUCP> ddc@osupyr.UUCP (Don Comeau) 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? > A better question is "Is there any good reason why this should be done?". In what situation would ++(a+b) provide any advantage over a+b+1 ? Generalization may be good if it provides some simplification, but in this case, neither the compiler writer nor the programmer benefit. I can't think of any other case in which the semantics of an expression depend on whether or not the arguments are lvalues. > >Flames welcome! Maybe I'd learn something. > Sorry if I wasn't abusive enough. ---------------------------------------------------------------------- | Alan Filipski, GTX Corp, 2501 W. Dunlap, Phoenix, Arizona 85021, USA | | {ihnp4,cbosgd,decvax,hplabs,amdahl}!sun!sunburn!gtx!al (602)870-1696 | ----------------------------------------------------------------------