comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Problem with Unbounded Strings
Date: Sat, 5 Dec 2015 13:19:32 +0100
Date: 2015-12-05T13:19:32+01:00	[thread overview]
Message-ID: <1siyyh4jy0qq0$.1jb3196h6zjwc$.dlg@40tude.net> (raw)
In-Reply-To: 31641315-84b9-427a-bc53-9d246c38acfb@googlegroups.com

On Sat, 5 Dec 2015 02:22:36 -0800 (PST), Laurent wrote:

>>No, the strategy is to pass lines or other parts of the >message further 
>>instead of accumulating it in the memory. Instead of this >"hamster" design 
>>I would do something like: 
> 
>>   Buffer : String (1..Size); -- Input is accumulated here 
> 
> Eh isn't that a contradiction? There is still a buffer

For just one line. You are trying to merge an unlimited number of. This is
a waste of resources and potential problem with latencies. For example,
modern poorly designed text editors load whole file first. What happens
when the file is large? The editor gets blocked.

> and it is even combined with those evil accesses!?

Access is needed for the mix-in pattern. It is a language design bug that
the discriminant must be an access even if the target is a by-reference
type. Instead of mix-in you can pass stream to each call explicitly, which
is not better. Or you can pack the access type into a handle type. BTW,
Unbounded_String is just that, a handle type wrapping some access to the
dynamically allocated body.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2015-12-05 12:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 15:49 Problem with Unbounded Strings Laurent
2015-12-04 16:04 ` Dmitry A. Kazakov
2015-12-04 16:53   ` Laurent
2015-12-04 18:00     ` Niklas Holsti
2015-12-04 21:05       ` Laurent
2015-12-04 20:34     ` Dmitry A. Kazakov
2015-12-04 21:43       ` Laurent
2015-12-04 22:23         ` Dmitry A. Kazakov
2015-12-05 10:22           ` Laurent
2015-12-05 12:19             ` Dmitry A. Kazakov [this message]
2015-12-05 13:15               ` Laurent
2015-12-04 18:08 ` Jeffrey R. Carter
2015-12-04 21:21   ` Laurent
2015-12-04 21:59     ` Simon Wright
2015-12-04 23:19       ` Laurent
2015-12-04 22:02     ` Dmitry A. Kazakov
2015-12-04 22:28     ` Jeffrey R. Carter
2015-12-04 23:35       ` Laurent
2015-12-04 23:59         ` Jeffrey R. Carter
2015-12-05 10:13           ` Laurent
2015-12-08  1:53           ` Randy Brukardt
2015-12-04 23:00     ` Ben Bacarisse
replies disabled

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