comp.lang.ada
 help / color / mirror / Atom feed
From: Charles Hixson <charleshixsn@earthlink.net>
Subject: Re: S'Write and How To Count Bytes
Date: 2000/10/06
Date: 2000-10-06T00:00:00+00:00	[thread overview]
Message-ID: <39DE4068.7D515BE0@earthlink.net> (raw)
In-Reply-To: 39D8A867.ADC8DDD@acm.org

[-- Attachment #1: Type: text/plain, Size: 2382 bytes --]

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


[-- Attachment #2: Card for Charles Hixson --]
[-- Type: text/x-vcard, Size: 145 bytes --]

begin:vcard 
n:Hixson;Charles
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:charleshixson@earthling.net
fn:Charles Hixson
end:vcard

  reply	other threads:[~2000-10-06  0:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-30  0:00 S'Write and How To Count Bytes Marin David Condic
2000-10-01  0:00 ` David C. Hoos, Sr.
2000-10-02  0:00   ` Dr. Joachim Schr�er
2000-10-02  0:00     ` Marin David Condic
2000-10-06  0:00       ` Charles Hixson [this message]
2000-10-02  0:00   ` Marin David Condic
2000-10-02  0:00     ` Ted Dennison
2000-10-02  0:00       ` tmoran
2000-10-02  0:00         ` tmoran
2000-10-02  0:00           ` Marin David Condic
2000-10-11  0:00             ` Nick Roberts
2000-10-11  0:00               ` Marin David Condic
2000-10-02  0:00           ` Ted Dennison
2000-10-02  0:00         ` Marin David Condic
2000-10-03  0:00       ` Robert A Duff
2000-10-06  0:00         ` Randy Brukardt
2000-10-07  0:11           ` Ted Dennison
2000-10-06  0:00             ` Randy Brukardt
2000-10-07  0:00             ` Marin David Condic
2000-10-08  0:00               ` Jean-Pierre Rosen
2000-10-09  0:00                 ` Randy Brukardt
2000-10-11  0:00                 ` Marin David Condic
2000-10-02  0:00 ` David C. Hoos, Sr.
2000-10-02  6:58 ` tmoran
2000-10-02  0:00   ` Marin David Condic
  -- strict thread matches above, loose matches on Subject: below --
2000-10-02  0:00 tmoran
2000-10-03  5:21 ` Marin David Condic
2000-10-03  0:00 Mario Amado Alves
2000-10-03  0:00 ` Marin David Condic
replies disabled

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