comp.lang.ada
 help / color / mirror / Atom feed
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
Date: 15 Jan 92 06:04:54 GMT	[thread overview]
Message-ID: <1992Jan15.060454.16683@milton.u.washington.edu> (raw)

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)
-------------------------------------------------------------------------------

             reply	other threads:[~1992-01-15  6:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-01-15  6:04 csus.edu!wupost!zaphod.mps.ohio-state.edu!mips!cs.uoregon.edu!nntp.uorego [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-01-15 17:37 Ada statement bu.edu!rpi!usenet.coe.montana.edu!ogicse!verdix!brucej
1992-01-15 17:13 Stan McQueen
1992-01-15 15:11 Greg Harvey
1992-01-15  6:09 dog.ee.lbl.gov!network.ucsd.edu!usc!sdd.hp.com!uakari.primate.wisc.edu!us
1992-01-15  1:15 dog.ee.lbl.gov!network.ucsd.edu!swrinde!mips!zaphod.mps.ohio-state.edu!so
1992-01-14 22:16 Jim Giles
1992-01-14 21:39 Jeffrey M. Schweiger
1992-01-14 20:49 david.c.willett
1992-01-14 19:18 Brian Hanafee
1992-01-14  3:13 csus.edu!wupost!spool.mu.edu!news.cs.indiana.edu!bronze!master.cs.rose-hu
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox