From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 15 Jan 92 06:04:54 GMT From: csus.edu!wupost!zaphod.mps.ohio-state.edu!mips!cs.uoregon.edu!nntp.uorego n.edu!milton!mfeldman@ucdavis.ucdavis.edu (Michael Feldman) Subject: Re: Ada statement Message-ID: <1992Jan15.060454.16683@milton.u.washington.edu> List-Id: In article <1992Jan14.031331.18320@cs.rose-hulman.edu> eigenstr@zoe.cs.rose-hul man.edu (Todd R. Eigenschink) writes: [ stuff deleted ] > > Why the HELL is there the NULL statement????????????? > >There's only one use as far as I can tell...to fill an empty procedure/ >function declaration so that the body isn't empty. So why not just allow >an empty body? > NULL can be useful in e.g. a CASE statement, which requires that all values of the case variable be accounted for. WHEN OTHERS => NULL; is often handy to write if no action is needed. The NULL statement is similar to "THIS PAGE IS INTENTIONALLY LEFT BLANK" in documents - it indicates a DELIBERATE "leaving out" of something. Empty bodies are confusing; they lead to endless grief in C. Consider x = 1; while (x < 100); { x++ } This is an endless loop, because the carelessly placed semicolon after the while clause creates an empty loop body. This can't happen in Ada. Mike ------------------------------------------------------------------------------- Michael B. Feldman co-chair, SIGAda Education Committee Visiting Professor 1991-92 Professor Dept. of Comp. Sci. and Engrg. Dept. of Elect. Engrg. and Comp. Sci. University of Washington FR-35 The George Washington University Seattle, WA 98105 Washington, DC 20052 mfeldman@cs.washington.edu mfeldman@seas.gwu.edu (206) 632-3794 (voice) (202) 994-5253 (voice) (206) 543-2969 (fax) (202) 994-5296 (fax) -------------------------------------------------------------------------------