comp.lang.ada
 help / color / mirror / Atom feed
From: "Marc A. Criley" <mcqada@earthlink.net>
Subject: Re: Ada Examples and Problems
Date: Wed, 11 Apr 2001 19:01:42 GMT
Date: 2001-04-11T19:01:42+00:00	[thread overview]
Message-ID: <3AD49CB1.9160D850@earthlink.net> (raw)
In-Reply-To: aJ0B6.4405$FD1.520353@news6-win.server.ntlworld.com

"chris.danx" wrote:
> 
> This is something i'm going to have to watch out for in future.  I've got an
> idea about how to limit the chances of me running into this again.  I'm
> going to put a function for every type i might write to a stream (that's not
> dynamic in size) that gives the size of it's contents.
> 
> -- a function that returns the total size of all fields in type X;
> --
> function size_of_fields(t : in X) return natural;
> 
> Not the best option but certainly better than hardwiring it into the
> file/stream handling routines.

This just reminded me of a thread that was raging here for awhile last
year regarding the 'Size of types and objects versus the number of bytes
objects occupy in a stream (stream meaning the Stream_IO kind of
stream).

Bottom line:  There is _no_ required correspondence between those sizes.

This can be frustrating at times, and did engender some smoke and fire
in the newsgroup.  There are situations where one wants to know ahead of
time how many bytes something is going to occupy in a stream, but Ada
does not require that an ability to make that determination for all
types be available.

Marc A. Criley
Senior Staff Engineer
Quadrus Corporation
www.quadruscorp.com



  reply	other threads:[~2001-04-11 19:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-10 13:38 Ada Examples and Problems chris.danx
2001-04-10 17:53 ` chris.danx
2001-04-10 17:57   ` chris.danx
     [not found] ` <ERFA6.2041$FY5.146015@www.newsranger.com>
2001-04-11  9:51   ` chris.danx
2001-04-11 15:34     ` Ted Dennison
2001-04-11 17:18       ` chris.danx
2001-04-11 17:43         ` chris.danx
2001-04-11 19:01           ` Marc A. Criley [this message]
2001-04-11 19:56             ` chris.danx
2001-04-12  1:41               ` tmoran
2001-04-12 15:28         ` Ted Dennison
2001-04-12 18:56           ` chris.danx
2001-04-12 19:01             ` chris.danx
2001-04-12 21:47             ` Ted Dennison
2001-04-13  8:40               ` chris.danx
2001-04-12  1:41     ` tmoran
2001-04-12 10:15       ` chris.danx
replies disabled

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