comp.lang.ada
 help / color / mirror / Atom feed
From: stuart@inmet.UUCP
Subject: Re: variant records
Date: Wed, 5-Nov-86 11:35:00 EST	[thread overview]
Date: Wed Nov  5 11:35:00 1986
Message-ID: <4800005@inmet> (raw)
In-Reply-To: 2886@rsch.WISC.EDU


Objects created with an allocator are always constrained.  If 
explicit constraints are not supplied, the object is constrained 
by the default discriminant values (LRM 4.8(5)).  The easiest 
solution would be to declare the type "node" without discriminants:

    type node;
    type node_ptr is access node;
    type node is
        record
            next : node_ptr;
            xrec : rec;      -- will not be constrained
        end record;

If you want save space by allocating exact sized constrained objects,
"node" can be declared with discriminates.  However, calls on "new"
must include a constraint, and the free list would have to be an array 
of free lists, one for each possible discriminant value.

  parent reply	other threads:[~1986-11-05 16:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-10-31  9:08 variant records Dean Luick
1986-11-03 14:17 ` Bev Sobelman
1986-11-05 16:35 ` stuart [this message]
1986-11-06 15:40 ` stt
  -- strict thread matches above, loose matches on Subject: below --
1999-09-14  0:00 Variant Records Shawn Barber
1999-09-14  0:00 ` Matthew Heaney
1999-09-14  0:00 ` Mark Lundquist
1999-09-14  0:00 ` David C. Hoos, Sr.
2004-02-15 22:51 Variant records Ganesh Ramasivan
2004-02-16 10:57 ` Preben Randhol
2004-02-16 15:25   ` Ganesh Ramasivan
2004-02-16 15:46     ` Ludovic Brenta
2004-02-16 16:16     ` Preben Randhol
2004-02-17 14:37       ` Ganesh Ramasivan
2004-02-17 15:43         ` Preben Randhol
2004-02-16 16:59   ` Ganesh Ramasivan
2004-02-16 20:14     ` Simon Wright
2004-02-17 14:56       ` Ganesh Ramasivan
2004-02-17 15:31         ` Robert I. Eachus
2004-02-16 23:17 ` tmoran
replies disabled

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