comp.lang.ada
 help / color / mirror / Atom feed
From: friesen@psivax.UUCP (Stanley Friesen)
Subject: Re: Pascal vs. C
Date: Fri, 25-Jan-85 11:29:25 EST	[thread overview]
Date: Fri Jan 25 11:29:25 1985
Message-ID: <271@psivax.UUCP> (raw)
In-Reply-To: 6283@boring.UUCP

In article <1709@sdcrdcf.UUCP> markb@sdcrdcf.UUCP (Mark Biggar) writes:
>In article <268@psivax.UUCP> friesen@psivax.UUCP (Stanley friesen) writes:
>>	How does it do with the following problem.  Write a
>>*general purpose* fixed length record file I/O subroutine package,
>>which reads each record directly into the application's data
>>structure. Each application must be able to perform I/O on *any*
>>record structure desired simply by calling the appropriate
>>routine with a reference to the data structure as an argument.
>>The problem I see with implementing this in Pascal or Ada
>>is that the I/O routines *cannot* know what type the argument
>>is going to be since it can be *any* legal record or array type.
>
>This problem need to be specified a little more clearly, but as there are
>only clearification involves only 2 solutions I will give both.
>
>1)  If the user intends to only have one data type stored in each file.
>	then the problem is already solved by the standard packages
>	SEQUENTIAL_IO and DIRECT_IO specified in the Ada* LRM.
>	In this case the routines DO know the type of the argument.
>	These generic packages nedd to be instantiated use the
>	datatype as an argument before they can be used in a program.
>

	I meant version #1.  Actually what I wanted to know was
can you *write* the SEQUENTIAL_IO package and DIRECT_IO package
*in* Ada, and how would you do it? How would you declare the
dummy arguments in the routines?
	BTW, what is meant by "instantiate to use the data type"?
-- 

				Sarima (Stanley Friesen)

{trwrb|allegra|burdvax|cbosgd|hplabs|ihnp4|sdcsvax}!sdcrdcf!psivax!friesen

           reply	other threads:[~1985-01-25 16:29 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <6283@boring.UUCP>]
replies disabled

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