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,8d5bda3619cce0f8 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!u8g2000prd.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: C getchar() functionality in Ada Date: Tue, 17 Feb 2009 16:39:14 -0800 (PST) Organization: http://groups.google.com Message-ID: <8b9e97e1-0f91-458d-94de-9bfb44462c06@u8g2000prd.googlegroups.com> References: <4999ce31$0$90266$14726298@news.sunsite.dk> <3apeng.mtg.ln@hunter.axlog.fr> <499b1430$0$90267$14726298@news.sunsite.dk> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1234917554 29722 127.0.0.1 (18 Feb 2009 00:39:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 18 Feb 2009 00:39:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u8g2000prd.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:4658 Date: 2009-02-17T16:39:14-08:00 List-Id: On Feb 17, 12:24 pm, Hyman Rosen wrote: > Thomas Locke wrote: > > But I understand what you're saying: No end of line characters in Ada! > > Except perhaps when using Get_Immediate and Look_Ahead? > > The Ada design has the same error here as Pascal did. > End of Line and End of File are like a craps table; > you can know whether the table *was* hot or cold, but > you cannot know whether the table *will be* hot or > cold. Similarly, you cannot know whether you are at > end of line or end of file until you have tried reading > a character. Ada pretends otherwise, but behind the > scenes it's doing a secret character read-ahead, which > is what causes the odd behavior. > > I speak about the various modern OSes. Presumably, once > upon a time input was such that this paradigm made sense, > just like Fortran had special output formatting characters > to rotate the roll of paper. I'm not sure if you're implying that VMS is one of those OS's that are as outdated as Fortran's formatting characters and horse-drawn carriages, but when Ada's Text_IO package was designed, VMS was a big thing. And VMS text files do not (or didn't) have end-of-line "characters". They weren't organized just as amorphous streams of bytes as they are on Unix-like systems and on Windows, but the OS itself structured the files into lines. Ada was designed to be portable, so in that context I don't think its design was a mistake; a design that relied on text files to be viewed as having "characters" to separate lines, pages, etc., *would* probably have been a mistake, when the goal of portability is kept in mind. -- Adam