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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,2e66fe8b30e3ee2c X-Google-Attributes: gid103376,public From: Charles Hixson Subject: Re: S'Write and How To Count Bytes Date: 2000/10/06 Message-ID: <39DE4068.7D515BE0@earthlink.net>#1/1 X-Deja-AN: 678444282 References: <39D6891A.7DC448B6@acm.org> <8r9uf5$ocl@newsserv.vs.dasa.de> <39D8A867.ADC8DDD@acm.org> X-Accept-Language: en Content-Type: multipart/mixed; boundary="------------C896F5EF7408DF30F0EB2229" X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 970866797 198.94.156.19 (Fri, 06 Oct 2000 14:13:17 PDT) Organization: EarthLink Inc. -- http://www.EarthLink.net MIME-Version: 1.0 NNTP-Posting-Date: Fri, 06 Oct 2000 14:13:17 PDT Newsgroups: comp.lang.ada Date: 2000-10-06T00:00:00+00:00 List-Id: This is a multi-part message in MIME format. --------------C896F5EF7408DF30F0EB2229 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit In this special case it seems to me that you could write a long 0, divide your string into fixed length blocks, writing them as you created them, figure the total block count, go back to the beginning, and write the length there, (and then, probably, move back to the eof). Since you are returning an unconstrained string, you know ahead of time the type that you are returning. The more general case, where you don't know ahead of time the KIND of value being returned, is more difficult. I don't know of any decent way to do this in a statically bound language, though Lisp, Smalltalk, Python, etc. can handle this by having a run-time interpreter manage the variable assignments. And I guess I have to add Visual Basic into this list, also, out of fairness. Marin David Condic wrote: > "Dr. Joachim Schr�er" wrote: > > > The 'read, 'write attributes are for constrained types. > > For unconstrained types (including tagged types/classwide types) > > there exist the 'input, 'output attributes. Note, that 'input > > is a function. If you want to overwrite 'input, 'output you just > > have to overwrite 'read, 'write cause they are used by the former. > > I've used the 'Input and 'Output in the process of saving and reloading things > from a file. It works nicely. However, in this case, I can't have all the dope > information in the output. See some of the other posts in this thread where I > explain it in a little more detail. Also, even with the 'Input and 'Output, you > don't seem to have any means of determining in advance how big a stream of bytes > you will produce from the operation. I don't see an obvious answer and perhaps > no good one exists. Probably you would have to convert the data to get the size, > then convert it again to get the size into the output. > > MDC > -- > ====================================================================== > Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/ > Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m > Visit my web site at: http://www.mcondic.com/ > > "Giving money and power to Government is like giving whiskey > and car keys to teenage boys." > > -- P. J. O'Rourke > ====================================================================== -- (c) Charles Hixson -- Addition of advertisements or hyperlinks to products specifically prohibited --------------C896F5EF7408DF30F0EB2229 Content-Type: text/x-vcard; charset=us-ascii; name="charleshixsn.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Charles Hixson Content-Disposition: attachment; filename="charleshixsn.vcf" begin:vcard n:Hixson;Charles x-mozilla-html:FALSE adr:;;;;;; version:2.1 email;internet:charleshixson@earthling.net fn:Charles Hixson end:vcard --------------C896F5EF7408DF30F0EB2229--