Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!brutus.cs.uiuc.edu!apple!oliveb!mipos3!omepd!merlyn From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.lang.c Subject: Re: Named Blocks (Was Re: Oh noooooo!!) Message-ID: <4915@omepd.UUCP> Date: 9 Sep 89 04:06:33 GMT References: <7598@goofy.megatest.UUCP> <475@thirdi.UUCP> Sender: news@omepd.UUCP Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Hillsboro, Oregon, USA Lines: 29 In-reply-to: peter@thirdi.UUCP (Peter Rowell) In article <475@thirdi.UUCP>, peter@thirdi (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. | Borrowing heavily from SAIL, a named block could be defined as one that | has a string constant immediately following the opening curly brace. Perl has 'em. LINE: while ($_ = ) { # read a line into variable $_ ...; while ($something_needs_to_be_done) { ...; ...; next LINE if time > $quitting_time; # jump out to the outer loop ...; } ...; } Works pretty well. Just another Perl hacker, -- /== Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ====\ | on contract to Intel, Hillsboro, Oregon, USA | | merlyn@iwarp.intel.com ...!uunet!iwarp.intel.com!merlyn | \== Cute Quote: "Welcome to Oregon... Home of the California Raisins!" ==/