comp.lang.ada
 help / color / mirror / Atom feed
From: voder!wlbr!lonex.radc.af.mil!blackbird.afit.af.mil!dlindsle@ucbvax.Berkel ey.EDU  (David T. Lindsley)
Subject: Re: What should this do?
Date: 1 Jul 91 15:21:34 GMT	[thread overview]
Message-ID: <1991Jul01.152134.16085@afit.af.mil> (raw)

rharwood@east.pima.edu writes:

>In article <1991Jun28.193513.14271@afit.af.mil>, dlindsle@afit.af.mil (David T
.
>Lindsley) writes:


>procedure test_100 is

>             subtype INDEX is natural range 0..100;
>             type DYN_STRING (SIZE : INDEX := 0) is private; 

>           private
>                 type DYN_STRING (size : index := 0) is
>                    record
>                        DATA : string (1..size);
>                    end record;

And this version does compile, even here.  Sorry about that, folks.  Our
AC is broken (it's 85F/30C-plus in here), and I'd been messing with that
package all day.
What I couldn't get to compile/run was:


  subtype Index is natural; -- range 0..100;
  type Dyn_String (Size : Index := 0) is record
    Data : string (1..Size);
  end record;

  S: Dyn_String;


But this still leaves me with a question.  Why does this work with a
constrained subtype, but not with an unconstrained one?  Either results
in the elaboration of a null array -- why is this a problem with an
unconstrained subtype?  (Especially since NATURAL is a discrete (sub)type
anyway...

-- 
Dave Lindsley	#24601#			OPINIONS.  MINE.  (Nobody tells me
dlindsle@blackbird.afit.af.mil		  anything anyway, so I can't possibly 
    ?? lamroN eb yhW ??			  be anybody's mouthpiece...)

             reply	other threads:[~1991-07-01 15:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-07-01 15:21 voder!wlbr!lonex.radc.af.mil!blackbird.afit.af.mil!dlindsle [this message]
  -- strict thread matches above, loose matches on Subject: below --
1991-07-02 17:09 What should this do? cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!petunia!nwebre
1991-07-02 13:06 Fred Stluka
1991-07-01 12:45 CBW Consulting
1991-06-28 19:35 David T. Lindsley
1991-06-28 21:40 ` Howard Turner
1991-06-29  0:31 ` Jim Showalter
1991-06-29 16:44   ` Michael Feldman
1991-06-29 21:22     ` Jim Showalter
1991-06-29  5:52 ` rharwood
replies disabled

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