Path: utzoo!mnetor!uunet!husc6!cca!g-rh From: g-rh@cca.CCA.COM (Richard Harter) Newsgroups: comp.lang.c Subject: Re: The D Programming Language: cases (fallthrough) Message-ID: <25348@cca.CCA.COM> Date: 6 Mar 88 19:08:59 GMT References: <222965b9@ralf.home> <2403@umd5.umd.edu> <25200@cca.CCA.COM> <401@tub.UUCP> Reply-To: g-rh@CCA.CCA.COM.UUCP (Richard Harter) Organization: Computer Corp. of America, Cambridge, MA Lines: 38 Keywords: C case fallthrough In article <401@tub.UUCP> cabo@tub.UUCP (Carsten Bormann) writes: >In article <25200@cca.CCA.COM> g-rh@CCA.CCA.COM.UUCP (Richard Harter) writes: >[about a solution to get back some expressive power that will be lost if > ``case'' implies ``break'':] > >(Current) C already has a good fallthrough statement. >It is called (surprise): >goto. [transferring between cases goto shown.] But, but, but... I had naturally supposed that the goto would be dropped from D. :-) Actually, does anyone use goto's in C to any signifigant extent? Currently I average about one goto per 10,000 lines of code, all of them being transfers to a procedure epilog, e.g foobaz() { .... allocate space and other setup .... if (some_special_condition) goto wrapup; .... wrapup: deallocate space and other cleanup } Almost every language has a goto construct, apparently on the principle "We know you won't use goto's, but there might be a special case where you need one, so here it is - better to be safe than sorry." But do people actually use it to any signifigant extent? Why not just drop it? -- In the fields of Hell where the grass grows high Are the graves of dreams allowed to die. Richard Harter, SMDS Inc.