Path: utzoo!utgpu!water!watmath!clyde!rutgers!psuvax1!vu-vlsi!devon!paul From: paul@devon.UUCP (Paul Sutcliffe Jr.) Newsgroups: comp.lang.c Subject: Re: New Features: ++(expr) Summary: poor argument Keywords: lvalue expression Message-ID: <681@devon.UUCP> Date: 13 Feb 88 17:47:19 GMT References: <386@osupyr.UUCP> <1102@bc-cis.UUCP> Reply-To: paul@devon.UUCP (Paul Sutcliffe Jr.) Organization: Devon Computer Services, Lancaster, PA Lines: 35 In article <1102@bc-cis.UUCP> john@bc-cis.UUCP (John L. Wynstra) writes: > In article <386@osupyr.UUCP> ddc@osupyr.UUCP (Don Comeau) writes: > > Since everyone else is suggesting their addition 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, can you say redundant? You said it yourself, the thing is > `(expression)+1', why have another name for the same thing? And as to > the traditional use, why would ++ or -- ever apply to anything but > lvalues (remembering that *(pointer-expression) is one)? > You guys on the ANSI committee, leave my C alone! (I like it K&&R > thank'ee, black, no sugar, please.) John, your coffee cup (as well as your statement) are full of holes. Sure, ++expression is redundant. So is ++lvalue. If you dispise the redundancy, why have ++ and -- at all, since I can easily use lvalue = lvalue + 1 or lvalue += 1 Of course, for lvaluse, ++ and -- are K&R 'C', so you must have them, yet you say Don's suggestion is bad. Think about it. - paul -- Paul Sutcliffe, Jr. +----------------------+ | THINK ... | UUCP (smart): paul@devon.UUCP | or THWIM | UUCP (dumb): ...rutgers!bpa!vu-vlsi!devon!paul +----------------------+