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: a07f3367d7,56525db28240414a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.216.233.196 with SMTP id p46mr975157weq.0.1343789444486; Tue, 31 Jul 2012 19:50:44 -0700 (PDT) Received: by 10.66.89.196 with SMTP id bq4mr3468779pab.26.1343789444370; Tue, 31 Jul 2012 19:50:44 -0700 (PDT) Path: q11ni15937998wiw.1!nntp.google.com!12no2030892wil.1!news-out.google.com!g9ni7594064pbo.0!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nrc-news.nrc.ca!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Efficient Sequential Access to Arrays Date: Thu, 26 Jul 2012 20:56:49 +0200 Organization: cbb software GmbH Message-ID: <1qlao21lvhn4q.p95zkkqzzcqz$.dlg@40tude.net> References: <01983f1c-f842-4b1f-a180-bcef531dad4c@googlegroups.com> <87ipdf4vh6.fsf@mid.deneb.enyo.de> <4ce44d2d-d789-42a0-a6ed-035f7f8d58be@googlegroups.com> <1d20andzhb0rk.ytxhpkza8tky$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 9A8bJrx4NhDLcSmbrb6AdA.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 X-Received-Bytes: 2695 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-07-26T20:56:49+02:00 List-Id: On Thu, 26 Jul 2012 10:40:32 -0700 (PDT), Shark8 wrote: > On Thursday, July 26, 2012 7:46:04 AM UTC-6, Dmitry A. Kazakov wrote: >> >> Some would disagree, but IMO in a well-written Ada program you should never >> ever need 'Valid. Don't do Unchecked_Conversion with doubtful outcome. >> Don't use stream attributes for constrained types. > > It might not be avoidable though; the presence of 'Valid however does let > you ensure that your [sub]typing assumptions are met. These assumptions must be upheld per value construction. > This might be especially true if you're importing data from some > third-party where the input-format doesn't specifically conform to your > expected-inputs. (This happens with disturbing frequency in handling > electronic medical records; usually because whoever started the record was > using a spreadsheet.) Since this stuff is my primary occupation, a word of caution: don't do it this way. Always implement the protocol layers as defined, right from the representation data types (e.g. octet), up to Ada native ones. Never ever use representation clauses to cut corners. >> Don't use for X'Address >> use Z'Address for the purpose of conversion etc. > > What do you mean here? Overlaying? Yes. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de