comp.lang.ada
 help / color / mirror / Atom feed
From: matthewsj@saic.com (John B. Mattehws, M.D.)
Subject: Slicing & sliding
Date: 1999/04/23
Date: 1999-04-23T00:00:00+00:00	[thread overview]
Message-ID: <matthewsj-ya023680002304991515390001@news.saic.com> (raw)


Given the following program

with Text_IO;

procedure Slice is

S : String (1 .. 64) := (others => '.');

    function F return String is
    begin
        return "result";
    end F;

begin

    Text_IO.Put_Line(S);
    S(S'Range) := F(S'Range);
    Text_IO.Put_Line(S);
    
end Slice;

The output is
................................................................
result

I was suprised to see that the indicated slice of F (F(S'Range)) is allowed
to be larger than the result returned by F, despite RM 4.1.2(7). For
smaller slices, the remainder of S seems to slide down, and the rest is
padded with nulls. Can someone help me understand this? Is this conformant
with the RM?

Thanks,

John
----
John B. Matthews, M.D.
matthewsj@saic.com; jmattthews@nova.wright.edu




             reply	other threads:[~1999-04-23  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-23  0:00 John B. Mattehws, M.D. [this message]
1999-04-23  0:00 ` Slicing & sliding Tucker Taft
1999-04-25  0:00   ` John B. Matthews, M.D.
replies disabled

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