Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site allegra.UUCP Path: utzoo!linus!decvax!harpo!eagle!allegra!alan From: alan@allegra.UUCP Newsgroups: net.lang.c Subject: Re: Breaking out of labeled statements - (nf) Message-ID: <1799@allegra.UUCP> Date: Wed, 31-Aug-83 10:13:24 EDT Article-I.D.: allegra.1799 Posted: Wed Aug 31 10:13:24 1983 Date-Received: Thu, 1-Sep-83 04:37:37 EDT References: <2672@uiucdcs.UUCP> Organization: Bell Labs, Murray Hill Lines: 33 Another thing that would be very useful in case statements would be a 'recase' verb, which would restart the enclosing switch (i guess in C it would be 'reswitch'). It is often useful to be able to recognize some cases as only minor variants of others, and process them by using a prologue for one variant followed by the existing case treatment shared between them. A reswitch verb would make this trivial. In certain cases, C allows you to do exactly what you're asking for. switch (a) { case ONE_THING: /* code for ONE_THING */ break; case A_VARIATION_ON_A_SECOND_THING: /* prologue, then fall through... */ case A_SECOND_THING: /* common code for A_SECOND_THING and variation */ break; } Of course, there can't be two variations, each with its own prologue, of one case, so this is of limited use. Alan Driscoll Bell Labs, Murray Hill