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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c1da643bcd91f37b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Advice on low level file handling. Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Thu, 6 Apr 2006 14:46:47 +0200 Message-ID: NNTP-Posting-Date: 06 Apr 2006 14:46:51 MEST NNTP-Posting-Host: db44886d.newsread4.arcor-online.net X-Trace: DXC=9=@nH:WbTY`ci]h2U0KHce:ejgIfPPlddjW\KbG]kaMh]kI_X=5Keaffgmd^[B9Gia[6LHn;2LCVn7enW;^6ZC`dIXm65S@:3>o X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:3737 Date: 2006-04-06T14:46:51+02:00 List-Id: 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