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: a07f3367d7,39579ad87542da0e X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII X-Received: by 10.180.76.174 with SMTP id l14mr5417886wiw.5.1369279416239; Wed, 22 May 2013 20:23:36 -0700 (PDT) Path: fw11ni1136wic.0!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.panservice.it!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Seeking for papers about tagged types vs access to subprograms Date: Wed, 15 May 2013 16:21:52 +0200 Organization: A noiseless patient Spider Message-ID: References: <12gn9wvv1gwfk.10ikfju4rzmnj.dlg@40tude.net> Mime-Version: 1.0 Injection-Date: Wed, 15 May 2013 14:17:56 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="9a0d11e58ba588466424cad2fbc22465"; logging-data="12680"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YDk/a1KFvzXq0EUhENk5M" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: Cancel-Lock: sha1:ba8zed294VcMIWD+6VCmdXUvd2g= X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: 2013-05-15T16:21:52+02:00 List-Id: Le 14/05/2013 21:56, Robert A Duff a �crit : > "J-P. Rosen" writes: >> ... I remember VMS had to invent new access >> methods specifically for C, because the VMS view of a file was too high >> level for C. > > Interesting. I don't see why -- VMS files can represent a > "sequence of bytes", among other things. It was long ago, but AFAIR, VMS had several forms of structured files, that were very inconvenient for C - DEC added another one later for raw bytes > [...] And the Get_Line procedure requires a fixed-length string, > and the length of that string is guaranteed to be both too short and too > long. (I'm talking about flaws in the original design, here, so Ada 83 > -- I realize a Get_Line function was later added.) I have written my own Get_Line function, which is perfectly Ada-83 compatible. True enough, the Ada-83 mantra was "Ada is so powerful, you can write anything you need" - and then people complained that they had to rewrite everything. That's why the library was considerably increased later on. But on the principle, dealing with long lines was not really a problem, and did not require buffers of arbitrary limited size. > [...] > Furthermore, lots of programs do NOT want that two-level structure. > They just want a sequence of characters, with one (not two!) > particular character that means "line break". They want to have > code like: > > ... loop > case Current_Char is > ... > > where a line break is treated similarly (or identically) > to ' '. The GNAT front end is like that (the lexical > analysis, I mean), and it doesn't use Text_IO to read the > source text. > The proper (and easy) way to check for the end of line is to call the function mysteriously called End_Of_Line ;-). I don't see a problem with that. If you want to replace end of lines with a particular character, just write your custom Get_Char function (you'll have to write it anyway to manage look-ahead characters). On the opposite, I don't like languages that invent characters on the fly. In Ada, you read the characters that are in the file. The end of line is not a character in a sufficiently evolved operating system. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr