comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: questions on input/output
Date: Sat, 6 Feb 2021 08:21:49 +0100	[thread overview]
Message-ID: <rvlg2c$jnd$1@dont-email.me> (raw)
In-Reply-To: <e474dbb0-0aa4-4540-89ac-50c216d905ffn@googlegroups.com>

Le 06/02/2021 à 01:59, Mehdi Saada a écrit :
> I had no idea input/output was that cumbersome !
It is not, but you have to understand the logic behind it, which might 
be different from what you know from other languages.

For example, Text_IO is compatible with keyboards, async lines, etc. 
What would backspacing mean on these?

And Ada has nice features to make your life easier, especially the 
ability to have dynamically size arrays. If you want a full line and 
don't want to care with the length, just do the following:

declare
    Line : String := Get_Line;
begin
    -- do what you need to do
end;

This will reserve exactly the right size for Line, no possibility of 
buffer overflow, and no wasted space.

-- 
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

  parent reply	other threads:[~2021-02-06  7:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 22:50 questions on input/output Mehdi Saada
2021-02-05 23:36 ` Jeffrey R. Carter
2021-02-06  0:59   ` Mehdi Saada
2021-02-06  1:34     ` Mehdi Saada
2021-02-06  2:13       ` Paul Rubin
2021-02-06  7:21     ` J-P. Rosen [this message]
2021-02-06  9:36 ` Dmitry A. Kazakov
2021-02-06 10:38   ` AdaMagica
2021-02-06 11:37     ` Mehdi Saada
2021-02-06 11:51       ` Mehdi Saada
2021-02-06 18:10         ` Paul Rubin
2021-02-06 18:55           ` Mehdi Saada
2021-02-06 20:26             ` Paul Rubin
2021-02-07  8:52               ` Mehdi Saada
2021-02-07 20:38                 ` Paul Rubin
2021-02-07  9:55             ` Gautier write-only address
2021-02-07 22:54               ` Mehdi Saada
2021-02-06 11:47     ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox