Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Apr 2002 09:30:42 -0500 (EST)
From:      Robert Watson <rwatson@FreeBSD.ORG>
To:        Paul Richards <paul@freebsd-services.com>
Cc:        Matthew Dillon <dillon@apollo.backplane.com>, Mike Barcroft <mike@FreeBSD.ORG>, "M. Warner Losh" <imp@village.org>, jake@locore.ca, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/i386/i386 critical.c src/sys/i386/include	cpufunc.h critical.h src/sys/i386/isa apic_vector.s icu_vector.s	src/sys/kern kern_fork.c kern_proc.c kern_switch.c src/sys/alpha/alpha	critical.c src/sys/alpha/include cpufunc.h ...
Message-ID:  <Pine.NEB.3.96L.1020402092845.20010X-100000@fledge.watson.org>
In-Reply-To: <1017737264.43836.18.camel@lobster.freebsd-services.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 2 Apr 2002, Paul Richards wrote:

> >     Figuring out the difference between a statement and a declaration
> >     is the *ONLY* thing in a C parser that requires some sophistication.
> >     Having declarations appear only after open braces doesn't help the
> >     parsing in the least... once the parser figures out the difference,
> >     it's figured it out anywhere where a statement can occur.
> > 
> >     But even though I implemented this cool feature in DICE, I hardly ever
> >     used it.
> 
> This is the norm for most Perl programmers. It often makes a lot of
> sense. 

Yeah, I used to use the whole declaration-in-a-for-loop all the time when
I did a lot of C++ coding:

	for (int i = 0; i < 3; i++) {
	}

Was a lot more compact, and meant you got better warning handling for
variables local to the loop, not to mention less clutter at the top of the
function.  One of the few things I miss about C++, actually :-).

Robert N M Watson             FreeBSD Core Team, TrustedBSD Project
robert@fledge.watson.org      NAI Labs, Safeport Network Services



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1020402092845.20010X-100000>