From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,20c6ebf06f55144e X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: input/output exceptions Date: 2000/11/19 Message-ID: <8v90g0$ior$1@nnrp1.deja.com>#1/1 X-Deja-AN: 695442666 References: <3A2B4CF6@MailAndNews.com> <8v64ob$j2e$1@nnrp1.deja.com> <8v6ct8$jvj$07$1@news.t-online.com> <8v6lfe$rc7$07$1@news.t-online.com> X-Http-Proxy: 1.0 x52.deja.com:80 (Squid/1.1.22) for client 205.232.38.240 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sun Nov 19 16:52:17 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-11-19T00:00:00+00:00 List-Id: In article <8v6lfe$rc7$07$1@news.t-online.com>, Amal Kurian 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.