From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c11f3836a5a201d3,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-11 10:44:30 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!uchinews!newsswitch.lcs.mit.edu!howland.erols.net!netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail From: Charles Hixson Subject: Circular type definition problem Newsgroups: comp.lang.ada User-Agent: KNode/0.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-ID: <1s7V6.4021$Il5.510814@newsread1.prod.itd.earthlink.net> Date: Mon, 11 Jun 2001 17:44:29 GMT NNTP-Posting-Host: 158.252.218.133 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 992281469 158.252.218.133 (Mon, 11 Jun 2001 10:44:29 PDT) NNTP-Posting-Date: Mon, 11 Jun 2001 10:44:29 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net X-Received-Date: Mon, 11 Jun 2001 10:42:28 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:8565 Date: 2001-06-11T17:44:29+00:00 List-Id: 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?