comp.lang.ada
 help / color / mirror / Atom feed
From: Jerome Desquilbet <jDesquilbet@Rational.COM>
To: Alvin A Begaye <aab@pine.cse.nau.edu>
Subject: Re: Linked List within a record?
Date: 1996/05/09
Date: 1996-05-09T00:00:00+00:00	[thread overview]
Message-ID: <3191C6D5.167E@Rational.COM> (raw)
In-Reply-To: 4mjpb7$4gr@pine.cse.nau.edu


Alvin A Begaye wrote:
> 
> Why won't this work
> 
> package MyList is new gen_linked_list( Integer, "=" );
> 
> type arggh is record
>   ID          : Integer;
>   IntList     : MyList.List;
> end record;
> 
> when i compile i get. completion of nonlimited type cannot be limited.
> 
> is there a way to do this?
> 
> --
> Alvin Al Begaye -*- (520)523-7875 -*- aab@pine.cse.nau.edu

I understand that your Gen_Linked_List generic package declares the
generic type Gen_Linked_List.List formal parameter as being limited
private. In that case, you can't use it as a record component type
(assignment issues). The only workaround is to use an access to this
type. Like this:

    type List_Access_Type is access MyList.List;
    type Hggra is
        record
            Id              : Integer;
            Int_List_Access : List_Access_Type;
        end record;

Of course, you'll have a manage your self allocations and deallocations
of objects of type List_Access_Type.

  Jerome.




      parent reply	other threads:[~1996-05-09  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-05  0:00 Linked List within a record? Alvin A Begaye
1996-05-07  0:00 ` James A. Krzyzanowski
1996-05-09  0:00 ` Jerome Desquilbet [this message]
replies disabled

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