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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,64d33c985c8959f0 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.42.146.3 with SMTP id h3mr10090496icv.2.1320619683753; Sun, 06 Nov 2011 14:48:03 -0800 (PST) Path: h5ni6346pba.0!nntp.google.com!news2.google.com!postnews.google.com!j36g2000prh.googlegroups.com!not-for-mail From: Jerry Newsgroups: comp.lang.ada Subject: Re: How does Ada.Text_IO.Enumeration_IO work? Date: Sun, 6 Nov 2011 14:42:11 -0800 (PST) Organization: http://groups.google.com Message-ID: <45161063-8da9-4163-8c3c-db469540ace9@j36g2000prh.googlegroups.com> References: <865d6298-5a0b-45c5-b0fc-372d6222752f@z22g2000prd.googlegroups.com> <7223b173-df96-4a12-82c0-268b7512e958@j36g2000prh.googlegroups.com> <67163342-cdc1-427d-9267-c41b51c9e08f@a12g2000vbz.googlegroups.com> NNTP-Posting-Host: 97.117.182.115 Mime-Version: 1.0 X-Trace: posting.google.com 1320619683 28916 127.0.0.1 (6 Nov 2011 22:48:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 6 Nov 2011 22:48:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j36g2000prh.googlegroups.com; posting-host=97.117.182.115; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HLUARECNK X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4,gzip(gfe) Xref: news2.google.com comp.lang.ada:14324 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2011-11-06T14:42:11-08:00 List-Id: On Nov 4, 4:31=A0pm, Adam Beneschan wrote: > On Nov 4, 3:46=A0pm, Jerry wrote: > > > > > > > > 'Cuz the rules say so. =A0A.10.6(5) is the important one here: "Next, > > > characters are input only so long as the sequence input is an initial > > > sequence of an identifier or of a character literal (in particular, > > > input ceases when a line terminator is encountered). The character or > > > line terminator that causes input to cease remains available for > > > subsequent input." =A0A.10.6(10): "The exception Data_Error is > > > propagated by a Get procedure if the sequence finally input is not a > > > lexical element corresponding to the type, in particular if no > > > characters were input ...". =A0That's the case when your input (skipp= ing > > > leading blanks) starts with an invalid character like a comma. =A0Sin= ce > > > the comma can't be the first character of an enumeration literal, the > > > comma "remains available for subsequent input", and thus "no > > > characters are input" and Data_Error is raised. > > > Thanks, Adam. I believe that the clue for me is that "remains > > available for subsequent input" means that it is available only to non- > > enumeration input, characters excepted. > > I'm not sure what you mean by this. =A0If the first character in the > input (other than space) cannot be the start of an enumeration > literal, the input will stop right there; and that character remains > available in the input. =A0If you then try to perform input using > Enumeration_IO (without any other input routines in between), that > same character is "available" in the input but causes Enumeration_IO > to fail again for the same reason. =A0Perhaps there's some confusion > about what the RM means by "available". =A0"The character remains > available for subsequent input" means that *any* input routine will > see that character first (and could raise an exception if that > character is not legal). =A0It doesn't mean that the input routine will > succeed. =A0But you could suck the character up with Text_IO.Get (to get > one character), and then the character isn't available for input any > more. =A0I hope this doesn't confuse you more, but I couldn't tell from > your comment whether things were clear to you; and if not, I was > hoping to try to make it clearer. > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -- Adam The source of confusion here is my poorly worded reply. What I meant to say (he said, sounding like a politician) is that the character will be "gotten" only by non-enumeration input attempts, character types excepted. Both RM and you are clear. Jerry