comp.lang.ada
 help / color / mirror / Atom feed
From: Dale Stanbrough <dale@goanna.cs.rmit.edu.au>
Subject: Re: Conceptual Ada Problems
Date: 1996/10/01
Date: 1996-10-01T00:00:00+00:00	[thread overview]
Message-ID: <52qcce$4i1@goanna.cs.rmit.edu.au> (raw)
In-Reply-To: Pine.GSO.3.93.960929230049.29986A-100000@firefly.sd.monash.edu.au



>I have a few questions regarding Ada, which hopefully someone
>will be able to answer:
>
>* Is there some way I would be able to access key fields
>  of generic data types (records)?

I presume you mean accessing the fields of a record inside a generic.
Not directly (after all the generic may be instantiated with type
integer, which has no fields!). You can supply a function to access
components of a record for your.


>* Is there some way of storing/retrieving records in an Ada.Direct_IO
>  file using key fields of records rather than their location in the file?

No, you have to build up an index yourself. you could save it to disc of
course, rather than building it up each time the program runs.


>* I am not quite sure how to declare functions/procedures as formal
>  parameters to a function/procedure.

Declare the subprograms at the library level, and then do...

	type func_ptr is access function (required profile) required return type


you can then take the 'access of a subprogram.

	
>* Also, the Ada compiler complains about some subtype mark being
>  required, in declaring an array comprising of generic linked lists.
>  Any suggestions on how to overcome this are more than welcome, as
>  I have been trying all day, to no avail!


you can't have generic linked lists, only generic packages & subprograms.
you may have a diff. problem to this, but this is all i can make out
of your description.

Dale




      parent reply	other threads:[~1996-10-01  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-29  0:00 Conceptual Ada Problems Vasilios Tourloupis
1996-09-29  0:00 ` Matthew Heaney
1996-09-29  0:00 ` Larry Kilgallen
1996-09-29  0:00   ` Robert Dewar
1996-10-01  0:00 ` Dale Stanbrough [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