comp.lang.ada
 help / color / mirror / Atom feed
* Circular type definition problem
@ 2001-06-11 17:44 Charles Hixson
  2001-06-11 20:16 ` Martin Dowie
  0 siblings, 1 reply; 3+ messages in thread
From: Charles Hixson @ 2001-06-11 17:44 UTC (permalink / raw)


This is what I'm trying to do:
        type Block;
        package Node_IO is      new Ada.Direct_IO(Block);
        use     Node_IO;
        type    BlockData       is      array (0..511) of Byte;
        type    Block   is      record
                next_node       :       Node_IO.Count;
                data                    :       BlockData;
        end record;     --      Block
        pragma pack(BlockData);
        pragma pack(Block);

Not too much to my surprise, it didn't work.  Node_IO needs to be 
defined with a real type.  OTOH, the type Node_IO.Count is 
defined within Node_IO, so I can't put it after the declaration 
of Block.

I suppose that I could just give up, and declare next_node to be 
Long_Integer, but that seems so inelegant.  Node_IO.Count is, 
essentially, an Access variable (it says where in the file to 
find the next Block).  But I'm not really sure how to approach 
this.  Any suggestions?



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

end of thread, other threads:[~2001-06-11 21:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-11 17:44 Circular type definition problem Charles Hixson
2001-06-11 20:16 ` Martin Dowie
2001-06-11 21:18   ` Charles Hixson

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