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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Seeking for papers about tagged types vs access to subprograms Date: Sun, 12 May 2013 17:26:34 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: <19lrzzbgm77v6.1dzpgqckptaj6.dlg@40tude.net> <1bfhq7jo34xpi.p8n2vq6yjsea.dlg@40tude.net> <12gn9wvv1gwfk.10ikfju4rzmnj.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 13 May 2013 00:22:51 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="656ea2f23126f57fb36504d2d15a002c"; logging-data="14595"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+VCXwpcm6UqbDHsTjh1aipEv/cwKHyCjw=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: Cancel-Lock: sha1:3M1vDVUJ3qyYvEMn16HGjRpigeE= Xref: news.eternal-september.org comp.lang.ada:15532 Date: 2013-05-12T17:26:34-07:00 List-Id: On 05/12/2013 03:15 PM, Robert A Duff wrote: > Jeffrey Carter writes: > >> I'm not sure I see the point in having an object for a closed file, > > Yeah, I was about to post basically the same thing. A closed file > is pretty useless. It's like an uninitialized variable -- you can't > do anything with it. > >> other than the requirements of low-level languages in which such things >> were 1st implemented. > > Low-level languages like Ada 83? ;-) Or even Ada 80 :) But I suspect everything goes back to how files were handled in 1950's assembly languages. > Yes, but I would have separate types for Input_File and Output_File. > Possibly another type for the rare case when you want to > read and write to/from the same file handle. Yes, that's an additional possible refinement. > But you couldn't use it like this: > > File : File_Info; -- Illegal! > ... -- some code that computes File_Name > File := Open (File_Name); -- Illegal! > > which is a limitation, compared to the current design of Text_IO > and friends. That's what block statements are for. -- Jeff Carter "I fart in your general direction." Monty Python & the Holy Grail 05