From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <61438dea6b0a264f8225382d0c6e2d51@9netics.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] A Plan 9 C request.... Date: Wed, 1 Mar 2006 10:09:24 -0800 From: Skip Tavakkolian <9nut@9netics.com> In-Reply-To: <20060301175613.GA826@augusta.math.psu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 08245752-ead1-11e9-9d60-3106f5b1d025 when it was added to C++, i "felt" that the scope of 'i' wasn't natural; it goes beyond 'for's closure. i like a behavior like this: { int i; for (i = 0, ...) ...; } > Here's a request for my favorite C feature from C99, which isn't yet in > Plan 9 C. I'd really like it if one could write statements of the form, > > for (int i = 0; i < 10; i++); > > or > > for (char *p = s; *p != '\0'; p++); > > That is, declare variables in the first part of a for loop. That would > be nice. Anyone care to add it to the compiler? I'd try it myself, but > I'm just too busy right now....