From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: ** X-Spam-Status: No, score=2.6 required=5.0 tests=BAYES_20,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.software-eng:3147 comp.lang.ada:3419 comp.lang.c:26801 comp.lang.fortran:2981 comp.lang.lisp:2901 comp.lang.misc:4408 comp.lang.modula2:2163 comp.lang.pascal:3210 comp.lang.scheme:1158 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!romp!auschs!d75!awdprime!sanders.austin.ibm.com From: sanders@sanders.austin.ibm.com (Tony Sanders) Newsgroups: comp.software-eng,comp.lang.ada,comp.lang.c,comp.lang.fortran,comp.lang.lisp,comp.lang.misc,comp.lang.modula2,comp.lang.pascal,comp.lang.scheme Subject: Re: problems/risks due to programming language, stories requested Message-ID: <1771@awdprime.UUCP> Date: 9 Mar 90 20:13:10 GMT References: <1004@micropen> <8218@hubcap.clemson.edu> Sender: news@awdprime.UUCP Reply-To: sanders@sanders.austin.ibm.com (Tony Sanders) Followup-To: comp.software-eng Organization: IBM AWD, Austin, TX List-Id: In article <8218@hubcap.clemson.edu> billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu writes: > So is a multi-alternative case, as provided by Ada: How do you do this in ADA? switch(n) { case 0: count++; case 1: ocount++; case 2: printf("%d %d\n",count,ocount); break; default: printf("unknown n\n"); break; } See how I left out the breaks on purpose. In ADA you wouldn't be able to do this without duplicating either the case-expression (they aren't always simple numbers) or the statements. -- sanders The 11th commandment: "Thou shalt use lint" For every message of the day, a new improved message will arise to overcome it. Reply-To: cs.utexas.edu!ibmaus!auschs!sanders.austin.ibm.com!sanders