comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: input/output exceptions
Date: 2000/11/19
Date: 2000-11-19T00:00:00+00:00	[thread overview]
Message-ID: <8v90g0$ior$1@nnrp1.deja.com> (raw)
In-Reply-To: 8v6lfe$rc7$07$1@news.t-online.com

In article <8v6lfe$rc7$07$1@news.t-online.com>,
  Amal Kurian <kurian.amal@t-online.de> wrote:
> While Robert Dewar pointed out, that 2.54 contains 2 and
> "junk" he should  also have stated that since 2.54 is the last
> value to be read in, Ada  ignores the junk and the program
> finishes while it couldn't ignore it if
> there is still something to be read in. ]


I find the above formulation confusing, it implies there is
something special about Ada here.

In fact it's quite simple. If you have junk in the input,
and you do not read the junk, the program will not notice
there is junk.

I would expect that to be true of any language with a
reasonably straightforward view of sequential input.

The only thing that is special about Ada, and hence really
the only point that needs special comment is that if
you write 2.54 and read an integer, then only the 2 is
read.

I think it is very important for people to have the skills
to figure out the obvious consequences of rules like this.
Yes, I deliberately did not spell out those obvious
consequences, because I think it is a good idea for people
to think their way through things.

If you make the effort to think your way to the right
conclusion, given the basic axioms, and learn how to do
this, then you learn a really valuable lesson, and perhaps
you will be able to solve your next problem without asking
CLA. It is interesting to note that the original questioner
was not the one complaining about the lack of a full answer :-)


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~2000-11-19  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-18  0:00 input/output exceptions Jean Cohen
2000-11-18  0:00 ` Robert Dewar
2000-11-18  0:00   ` Amal Kurian
2000-11-18  0:00     ` DuckE
2000-11-18  0:00       ` Amal Kurian
2000-11-19  0:00         ` Robert Dewar [this message]
     [not found]           ` <3A28353B.40B4F990@ebox.tninet.se>
     [not found]             ` <90dp4s$45c$1@nnrp1.deja.com>
2000-12-16 20:00               ` Stefan Skoglund
replies disabled

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