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,c5f68ab74d5099ee X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.205.136.10 with SMTP id ii10mr55608bkc.7.1324375750761; Tue, 20 Dec 2011 02:09:10 -0800 (PST) Path: jh9ni32958bkb.0!nntp.google.com!news2.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Interfaces.Shift_Left Date: Tue, 20 Dec 2011 11:08:23 +0100 Organization: cbb software GmbH Message-ID: References: <18214312-82f5-45c4-b20d-cb530b500929@h3g2000yqa.googlegroups.com> <5f989095-5c1c-4b23-a538-d70f4718b4b1@l19g2000yqc.googlegroups.com> <9ktu5mFn31U1@mid.individual.net> <9l71m2FlhuU1@mid.individual.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-12-20T11:08:23+01:00 List-Id: On Mon, 19 Dec 2011 18:38:53 -0600, Randy Brukardt wrote: [It is imperative vs. declarative debate] > Obviously, your mileage varies from mine. I presume you're not documenting > "the specification" in the code, because otherwise you would have to write > it twice (which would make the record types a lot more attactive). It must be done anyway, because when it comes to the protocols they are normally defined not in bits and offsets, but in some quite ugly quasi-language. Extraction of bits in an imperative manner as Niklas does, I do, and I bet many people dealing with protocols do, serves documentation purpose better, than translation from one cryptic declarative language to another (of Ada representation clauses). And fields is just a minor problem. The protocols have lots of other encoding stuff, which simply cannot be expressed by any clause. E.g. chain codes, padding, check sums etc. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de