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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,56525db28240414a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.77.39 with SMTP id p7mr705202paw.0.1343454384125; Fri, 27 Jul 2012 22:46:24 -0700 (PDT) Path: c10ni42086pbw.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Efficient Sequential Access to Arrays Date: Fri, 27 Jul 2012 22:32:15 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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> <1qlao21lvhn4q.p95zkkqzzcqz$.dlg@40tude.net> <802f6aec-a448-4a41-8320-fbdb5ffa7883@googlegroups.com> <1lqose2aygd4r$.ots4i45o7jnz.dlg@40tude.net> NNTP-Posting-Host: 69.20.190.126 Mime-Version: 1.0 X-Trace: posting.google.com 1343454383 1500 127.0.0.1 (28 Jul 2012 05:46:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 28 Jul 2012 05:46:23 +0000 (UTC) Cc: mailbox@dmitry-kazakov.de In-Reply-To: <1lqose2aygd4r$.ots4i45o7jnz.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.20.190.126; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-07-27T22:32:15-07:00 List-Id: >>> These assumptions must be upheld per value construction. >> >> Er, yes? Your value-construction procedure, which might be a >> stream-implementation, could use 'Input to ensure the data is valid, no? >> Then isn't the 'Read the value-construction? > >Neither. If you use stream you should do it properly, i.e. as the transpor= t >layer. The transport is defined in terms of bytes, characters or other >units. So the only read here might be Character'Read. Um, I think you completely misread what I was saying. You can use 'Read and= 'Write to handle your import/export to the requisite format; the 'Write sh= ouldn't be an issue (WRT validity; at this point your object should be vali= d and your writing it out should be straightforward), but the 'Read certain= ly needs to check for validity. Using Character'Read is perfectly reasonabl= e when talking about parsing from text into the internal types, as I was do= ing in my LISP interpreter; indeed I was using Character'Read. 'Valid might be a perfectly reasonable way to raise an exception; as I said= before many DBs do not have ranges on their values; if your data (say for = a simulation) is exported to a DB, then any import needs to check that the = constraints on the fields [present in the program, not present in the DB] h= ave not been broken. (A common cause would be because of some SQL update-st= atement some user ran.) Why would using 'Valid be the wrong way to go if th= ose constraints were strictly subranges?