comp.lang.ada
 help / color / mirror / Atom feed
From: aschwarz@acm.org (skidmarks)
Subject: Re: String Pointer Bug
Date: 9 Nov 2004 08:47:19 -0800
Date: 2004-11-09T08:47:19-08:00	[thread overview]
Message-ID: <35f054ea.0411090847.668b8d4e@posting.google.com> (raw)
In-Reply-To: mailman.83.1099920902.10401.comp.lang.ada@ada-france.org

"Christoph Karl Walter Grein" <AdaMagica@web.de> wrote in message news:<mailman.83.1099920902.10401.comp.lang.ada@ada-france.org>...
> A long time ago, I made an exegesis of this problem. You may find it below
> (sorry if the indentation should be lost, it's my mailer that swallows it, I do not know
> to avoid this):

Thank you. This is an excellent description. the only (fault) that I
can see is that it requires a copy operation (Y: aliased D := X).

I wonder, do you think that:

   Y: aliased D; for Y'Address use X'Address;

is a viable alternative (please note, I did not say GOOD alternative).

In this simple case, a copy serves no harm, other than some time. But
if the data is large the cost will certainly grow, perhaps to being
unacceptable.

Another (but unattractive) alternative might be:

    type S1 is String(1..1);
    type S2 is String(1..2);
             ooo
    type Sn is String(1..n);

    type S_Ptr  is access all String;
    type S1_Ptr is access all S1;
             ooo
    type Sn_Ptr is access all Sn;


and so on. But how really ugly.

thanks

art



  reply	other threads:[~2004-11-09 16:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-08 13:34 String Pointer Bug Christoph Karl Walter Grein
2004-11-09 16:47 ` skidmarks [this message]
2004-11-09 19:35   ` Martin Krischik
  -- strict thread matches above, loose matches on Subject: below --
2004-11-02 19:32 skidmarks
2004-11-04  6:18 ` Per Sandberg
replies disabled

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