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,a3fe2aac201210c0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada2005 (was Re: reading a text file into a string Date: Mon, 19 Jul 2004 14:51:48 +0200 Message-ID: <177fmvul99f8g$.1fnafx0bo7guy$.dlg@40tude.net> References: <40f6bf21@dnews.tpgi.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de brcAmTpZqo/tVUL+79E1cAdFVlW68lKQ7LW3SpxEZQSw+R5SM= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:2232 Date: 2004-07-19T14:51:48+02:00 List-Id: On Mon, 19 Jul 2004 11:51:52 +0000 (UTC), Peter Hermann wrote: > Robert I. Eachus wrote: >> For this reason, I find myself contructing or using a Get_Line FUNCTION >> inside a loop and a declare block: >> >> while not End_of_Line(Somefile) loop >> declare >> Buffer: String := Get_Line(Somefile); >> begin >> -- process buffer >> exception >> ... >> end; >> end loop; > > There is no compelling reason why such a FUNCTION get_line > should not be in package specification Ada.text_io of Ada2005. It would be nice. > Or did I miss something? In Ada community there is a strong resistance against functions having side-effects, even when side-effect is hidden in an *in* File_Type parameter. A counter example would be: What_Is_This : String := Get_Line (File) & Get_Line (File); -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de