comp.lang.ada
 help / color / mirror / Atom feed
From: taurus!aldebaran!schweige@lll-winken.llnl.gov  (Jeffrey M. Schweiger)
Subject: Re: Ada statement
Date: 14 Jan 92 21:39:18 GMT	[thread overview]
Message-ID: <3848@aldebaran.cs.nps.navy.mil> (raw)

In article <1992Jan14.031331.18320@cs.rose-hulman.edu> eigenstr@zoe.cs.rose-hul
man.edu (Todd R. Eigenschink) writes:
|I'm taking CS404 here, the compilers class, and this quarter, we're
|compiling a subset of Ada (We're using the book _Crafting_A_Compiler_ by
|Charles Fischer and Richard LeBlanc, Jr., should anyone care.).  I used
|Ada for two data structures classes last year, but never really thought
|about this then.  And now...the $64,000 question....
|
|	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?

The 'null' statement exists because the syntax demands that there be a
statement at a particular place in a program (and not just restricted to
function and procedure bodies), but is used if there is nothing to be done
at this point.  It should be noted the C also uses the null statement (";"), 
see K&R, 2nd edition, page 18).


|It's not like this is a big deal...compiling that is a piece of cake.  Here's
|the code from my semantic routine to compile said statement:
|
|void null_statement(void)
|{
|   smPopStack(TOSS);   /* Remove the semicolon from the semantic stack
|                          and heave it. */
|   smPopStack(TOSS);   /* Remove the NULL from the ss and do the same. */
|}
|
|Hey, don't get on my case just 'cuz I'm writing it in C...I think Ada's
|tolerable, and I love generic packages, but I just find it a little too
|restrictive for someone who knows what HE's doing (so shoot me for
|being politically incorrect) and wants to get something done NOW.

So tell me, what can't you do in Ada that you can do in C (not necessarily
by the same method, and with the same ease)?  I'm not saying that one language
might not be better than another for specific applications, but I felt your
comment merited some response.  I don't view it as a case of 'political
correctness.'  Ada compilers have been written in Ada.

[deleted]

|Todd Eigenschink
|eigenstr@CS.Rose-Hulman.Edu


Jeff Schweiger

-- 
*******************************************************************************
Jeff Schweiger	      Standard Disclaimer   	CompuServe:  74236,1645
Internet (Milnet):				schweige@taurus.cs.nps.navy.mil
*******************************************************************************

             reply	other threads:[~1992-01-14 21:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-01-14 21:39 Jeffrey M. Schweiger [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  6:04 csus.edu!wupost!zaphod.mps.ohio-state.edu!mips!cs.uoregon.edu!nntp.uorego
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 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