comp.lang.ada
 help / color / mirror / Atom feed
* recursive types and generics
@ 2003-05-02 16:19 alfonso acosta
  2003-05-02 17:09 ` Robert A Duff
  2003-05-02 17:12 ` Ludovic Brenta
  0 siblings, 2 replies; 3+ messages in thread
From: alfonso acosta @ 2003-05-02 16:19 UTC (permalink / raw)


Hi:

I need to code a recursive type: a Sequence which could contain 
sequences of the same type. Im trying to use a generic package for that 
purpouse. I provide a simplified example:

-------------------------------------------------------------------------
type Elem_Type is (Nothing, Int, Seq);

type Seq_Acces;

type Seq_Elem (Const : Elem_Type := Nothing) is
    record
      case Const is
        when Nothing => null;
        when Int     => I : Integer;
        when Seq     => S : Seq_Access;
         -- "invalid use of type before its full declaration"
      end case;
    end record;

package Myseq is new Sequence (Element => Seq_Elem);

type Seq_Access is access Myseq.Sequence; -- provided by the generic
                                           -- package
--------------------------------------------------------------------------

Any ideas about fixing it?

Alfonso Acosta




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-02 17:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-02 16:19 recursive types and generics alfonso acosta
2003-05-02 17:09 ` Robert A Duff
2003-05-02 17:12 ` Ludovic Brenta

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