From: news.centerline.com!noc.near.net!inmet!spock!stt@uunet.uu.net (Tucker Ta
Subject: Re: Language pitfalls (was Re: FORTRAN bug)
Date: 15 Dec 92 20:35:58 GMT [thread overview]
Message-ID: <1992Dec15.203558.18211@inmet.camb.inmet.com> (raw)
In article <1992Dec15.180821.17817@beaver.cs.washington.edu>
pattis@cs.washington.edu (Richard Pattis) writes:
> . . .
>Often the base case of a recursive function to manipulate a list looks like:
>
> IF mumble = NULL THEN
> RETURN NULL;
> ELSE ...
>
>What my students sometimes write is
>
> IF mumble = NULL THEN
> NULL;
> ELSE ...
>
>Here the statement NULL replaces the returning of a NULL value (which might be
>better to denote as NIL, at the expense of another reserved word). . . .
Oh boy. That is a nasty one. This argues for a "friendly"
Ada compiler giving a warning about any use of "null;" other
than the idiomatic ones like "when others => null;" or "begin null; end;"
(especially in a function that returns an access type ;-).
In retrospect, one could argue that it would have been better
to have no "null" statement at all (other than simply ";") than
to create a situation allowing this kind of one word error.
>Rich Pattis
S. Tucker Taft stt@inmet.com
Intermetrics, Inc.
Cambridge, MA 02138
next reply other threads:[~1992-12-15 20:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
1992-12-15 20:35 news.centerline.com!noc.near.net!inmet!spock!stt [this message]
-- strict thread matches above, loose matches on Subject: below --
1992-12-17 18:48 Language pitfalls (was Re: FORTRAN bug) John Halper
1992-12-17 14:18 Terry J. Westley
1992-12-17 1:31 Robert I. Eachus
1992-12-16 20:59 John Bollenbacher
1992-12-16 20:02 Julian C . Lander
1992-12-16 17:38 Bob Kitzberger
1992-12-16 17:27 Mark A Biggar
1992-12-16 16:32 olivea!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!asuvax!ennews
1992-12-16 14:38 crispen
1992-12-16 1:22 Robert I. Eachus
1992-12-15 18:08 Richard Pattis
1992-12-15 15:47 Michael Feldman
1992-12-15 14:55 David Emery
1992-12-15 13:55 enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!news.lth.se!dag
1992-12-14 21:57 Bob Kitzberger
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox