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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site psivax.UUCP Path: utzoo!dciem!nrcaero!pesnta!hplabs!sdcrdcf!psivax!friesen From: friesen@psivax.UUCP (Stanley Friesen) Newsgroups: net.lang.ada Subject: Re: Pascal vs. C Message-ID: <271@psivax.UUCP> Date: Fri, 25-Jan-85 11:29:25 EST Article-I.D.: psivax.271 Posted: Fri Jan 25 11:29:25 1985 Date-Received: Mon, 28-Jan-85 02:14:17 EST References: <4859@utzoo.UUCP> <11@mit-athena.ARPA> <177@gcc-opus.ARPA> <7055@brl-tgr.ARPA> <25@seismo.UUCP> <6283@boring.UUCP> <250@gumby.UUFri, 25-Jan-85 11:29:25 EST Reply-To: friesen@psivax.UUCP (Stanley friesen) Organization: Pacesetter Systems Inc., Sylmar, CA Summary: List-Id: 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