From: eachus@mitre-bedford.arpa (Robert I. Eachus)
Subject: Re: converting (limited) private types?
Date: 29 Sep 92 20:00:57 GMT [thread overview]
Message-ID: <EACHUS.92Sep29150057@Dr_No.mitre.org> (raw)
The most elegant way to solve this problem, and I do it every
time I have to do a lot of text file manipulation is to take your
favorite text editor and edit the specification of TEXT_IO. I usually
change the name to NICE_IO and build in whatever processing is
necessary to print out meaningful error messages when opening a file
fails, etc. In your case, redefine FILE_TYPE as a private type, and
then make it an access to TEXT_IO.FILE_TYPE. (If FILE_TYPE is already
an access type, there is an obvious optimization...I won't tell.)
Now write the body for the most part as calls through to TEXT_IO.
Slather pragma INLINE around liberally and you are ready to start
cooking. If you want to be a little more adventurous add functions
PUSH_CURRENT_IN, etc. to the package. See how easy that was? :-)
Seriously this does turn out to be a long term timesaver, since I
can and do add dozens of mixed output procedures, GET functions, etc.
to the mix.
--
Robert I. Eachus
with STANDARD_DISCLAIMER;
use STANDARD_DISCLAIMER;
function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...
next reply other threads:[~1992-09-29 20:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1992-09-29 20:00 Robert I. Eachus [this message]
-- strict thread matches above, loose matches on Subject: below --
1992-09-27 20:07 converting (limited) private types? cis.ohio-state.edu!news.sei.cmu.edu!ae
1992-09-26 21:08 Dave Marshall
1992-09-26 2:40 munnari.oz.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!cs.adelaide.edu.au!
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox