comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Advice on low level file handling.
Date: Thu, 6 Apr 2006 14:46:47 +0200
Date: 2006-04-06T14:46:51+02:00	[thread overview]
Message-ID: <y2z97az73h1v$.1x8op50bfjxk1$.dlg@40tude.net> (raw)
In-Reply-To: Xns979D55134B90Cpchapinsovernet@198.186.192.137

On 06 Apr 2006 12:21:08 GMT, Peter C. Chapin wrote:

> In other words: I probably need to treat the file as a blob of 
> unstructured, typeless data and impose structure on it at run time rather 
> than with compile time declarations. This seems somewhat contrary to the 
> ideals of strong typing, but I'm not sure I see a good alternative in a 
> case like this.

One way is to have a better control over the representation.

Another is to provide abstract record interface. The problem is that the
record view you want to use when dealing with read data does not correspond
to the memory layout. The question is, should it really correspond? It
might be better and easier for the language to provide user-defined
getter/setter interface supported by a predefined library for dealing with
endianess than to blow up representation clauses.

> I suppose this is why practical strongly typed languages 
> have escapes from their typing mechanisms. This problem must come up 
> frequently when writing programs that conform to externally defined binary 
> standards.

Not only this. The whole purpose of constructors and destructors is to
circumvent typing mechanism.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2006-04-06 12:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-02  2:47 Advice on low level file handling Peter C. Chapin
2006-04-02 10:55 ` Georg Bauhaus
2006-04-04  1:31 ` Randy Brukardt
2006-04-05 10:41   ` Peter C. Chapin
2006-04-06  7:43     ` Michael Paus
2006-04-06 12:21       ` Peter C. Chapin
2006-04-06 12:46         ` Dmitry A. Kazakov [this message]
2006-04-06 14:13         ` Bob Spooner
2006-04-07 10:48         ` Stephen Leake
replies disabled

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