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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,78b2880bc7e78e39 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-16 14:24:04 PST Path: supernews.google.com!sn-xit-03!supernews.com!news-xfer.nuri.net!newsfeed.dacom.co.kr!news.maxwell.syr.edu!hammer.uoregon.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison Sender: usenet@www.newsranger.com References: <98qumf$5sf$1@nh.pace.co.uk> <98r4g1$7r1$1@nh.pace.co.uk> <3AB22CB2.E8A851A5@averstar.com> <98to0v$6d2$1@nh.pace.co.uk> Subject: Re: RISC Message-ID: <9kws6.218$94.1074@www.newsranger.com> Date: Fri, 16 Mar 2001 22:19:49 GMT NNTP-Posting-Host: 127.0.0.1 X-Complaints-To: abuse@newsranger.com X-Trace: www.newsranger.com 984781189 127.0.0.1 (Fri, 16 Mar 2001 17:19:49 EST) NNTP-Posting-Date: Fri, 16 Mar 2001 17:19:49 EST Organization: http://www.newsranger.com Xref: supernews.google.com comp.lang.ada:5781 Date: 2001-03-16T22:19:49+00:00 List-Id: In article <98to0v$6d2$1@nh.pace.co.uk>, Marin David Condic says... > >Yes - this would be *very* nice! There are often in data streams things of >uncertain quantity which become very hard to represent in the usual Ada >structures. You get things like "This16 bit word will tell you how many >doohickies will follow...." and it will be surrounded by fixed data. It >doesn't map well to records - but maybe some other structure could be >created to handle it. Typically, you'll end up "rolling-your-own" by >building some kind of dynamic data structure to hold these things. You >construct the data structure as you read the data in. Not that hard to do, >but it would be *really* nice to describe one of these things at a high >level and just have all that done for you by the compiler. ASN.1 had a lot of this type of stuff. Take the standard "length octet" for instance (...please!). Bit 8 selects between "short form" and "long form". In "short form" the other 7 bits indicate the length of the contents. In "long form", the other 7 bits indicate how many of the following bytes are used to determinte the length of the rest of the contents. (Remember, no problem can't be solved by another level of indirection...) However, if bit 8 is on and the rest of the bits are off, then it indicates that we are using "indefinite form", where two terminator octets at the end of the contents determine the length. A week of wrestling with this kind of stuff several years ago was enough to convince me that there are always going to be some formats that just cannot be nicely handled at a high-level with something like a rep clause. --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com