Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!gem.mps.ohio-state.edu!ginosko!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: Named Blocks (Was Re: Oh noooooo!!) Summary: what's in a name? Message-ID: <297@crdos1.crd.ge.COM> Date: 7 Sep 89 15:05:34 GMT References: <7598@goofy.megatest.UUCP> <475@thirdi.UUCP> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: GE Corp R&D Center Lines: 31 In article <475@thirdi.UUCP>, peter@thirdi.UUCP (Peter Rowell) writes: | One thing I would have loved to have seen introduced by ANSI would have | been "named blocks", but I am sure that parsing them is a bitch. | Given this "improvement", the above might have been written: | | while(rule = (Rule*)Queue_iter_next(&rule_iter)) { "outer loop" | while(rsym = (Symbol*)Queue_iter_next(&rsym_iter)) { "inner loop" I think the idea of naming the loop rather than the block, as suggested earlier, would be easier to parse. Ex: while loop1 (a < b) { while (b = foo(2)) { /* stuff here */ if (m > 20) continue loop1; /* specifies the scope of the loop */ } /* this is where 'continue loop1' transfers */ } Disclamer: this is not my idea, and I am not offering an opinion on including it in the language. I think discussion of these features is a good way to have the major pitfalls discovered before someone has implemented them. -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "The world is filled with fools. They blindly follow their so-called 'reason' in the face of the church and common sense. Any fool can see that the world is flat!" - anon