comp.lang.ada
 help / color / mirror / Atom feed
From: mek100@york.ac.uk (Mark Kambites)
Subject: File chicken counts eggs
Date: 1997/05/07
Date: 1997-05-07T00:00:00+00:00	[thread overview]
Message-ID: <5kqku3$bch$1@netty.york.ac.uk> (raw)


Hello fellow Ada users!

I'm attempting to implement a B-tree-type structure on disk. This requires
that each node in the tree contains file indices, indicating where in the
file its children can be found. Such indices are implemented in Ada as the
'count' type which is declared in direct_io. Unfortunately, nothing in
direct_io is visible until direct_io has been instantiated, and I need
to instantiate it with my node as the generic type parameter. Have you
spotted the problem yet?

It seems that the size of my node must be known to the compiler before
direct_io can be instantiated, and the size of the node is dependant upon
the size of 'count', which is unknown UNTIL direct_io HAS BEEN instantiated.

Surely there must be a better way of handling this than trying to
effectively cast backwards and forwards between count and integer - exactly
the kind of thing Ada was designed to eliminate?

Any help much appreciated, espcially if its reasonably quick! :-)

   /\/)ark /-(ambites

------------------------------------------------------------------------------
 All opinions here expressed represent the views of either me when drunk or
 me when sober. The reader is granted absolute right to make a wild guess as
 to which is which. Hiccup.





--

   /\/)ark /-(ambites

------------------------------------------------------------------------------
 All opinions here expressed represent the views of either me when drunk or
 me when sober. The reader is granted absolute right to make a wild guess as
 to which is which. Hiccup.





             reply	other threads:[~1997-05-07  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-07  0:00 Mark Kambites [this message]
1997-05-08  0:00 ` File chicken counts eggs Nick Roberts
1997-05-08  0:00 ` Robert I. Eachus
replies disabled

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