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: a07f3367d7,56525db28240414a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Received: by 10.180.105.38 with SMTP id gj6mr756601wib.0.1343789550766; Tue, 31 Jul 2012 19:52:30 -0700 (PDT) Received: by 10.66.88.5 with SMTP id bc5mr3468561pab.11.1343789444742; Tue, 31 Jul 2012 19:50:44 -0700 (PDT) Path: q11ni15937998wiw.1!nntp.google.com!12no2092597wil.1!news-out.google.com!g9ni7594066pbo.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!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Vasiliy Molostov" Newsgroups: comp.lang.ada Subject: Re: Efficient Sequential Access to Arrays Date: Fri, 27 Jul 2012 11:01:17 +0400 Organization: None 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: Xw13RWgh8yxgPSv0x3+H9w.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.00 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 X-Received-Bytes: 4050 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-07-27T11:01:17+04:00 List-Id: Dmitry A. Kazakov =D0=BF=D0=B8=D1=81=D0=B0=D0= =BB(=D0=B0) =D0=B2 =D1=81=D0=B2=D0=BE=D1=91=D0=BC =D0=BF=D0=B8=D1=81=D1=8C= =D0=BC=D0=B5 Fri, = 27 Jul 2012 10:28:45 +0400: > On Thu, 26 Jul 2012 22:25:58 -0700 (PDT), Shark8 wrote: > >> On Thursday, July 26, 2012 12:56:49 PM UTC-6, Dmitry A. Kazakov wrote= : >>> 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 wrot= e: >>>>> >>>>> 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 do= es = >>>> let >>>> you ensure that your [sub]typing assumptions are met. >>> >>> 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 = > transport > layer. The transport is defined in terms of bytes, characters or other= > units. So the only read here might be Character'Read. no. We might object'read with any object. You are mixing abstraction = layers here. Even you refer to "or other units". >> Many DBs don't support such range subtyping, so why is it "bad form" = to >> ensure that such values, when read (ie value construction from the >> database) conform to the proper subtypes. (Though this might be done >> automatically on assignment from function if it falls outside the >> 'Range... I'll have to read up on when subtype constraints are applie= d.) > > When DB client does not support type mapping, you should always use th= e = > DB > native type, e.g. SQLINTEGER. Ada type must be obtained from that usin= g > type conversion. > > Which should be obvious if we remember that Ada discourages implicit t= ype > conversions. Why a DB to Ada one should be implicit? You suppose sqlinterger as property of any db which is wrong. -- = =D0=9D=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE =D0=B2 =D0=BF=D0=BE=D1=87= =D1=82=D0=BE=D0=B2=D0=BE=D0=BC =D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B5= =D0=B1=D1=80=D0=B0=D1=83=D0=B7=D0=B5=D1=80=D0=B0 Opera: http://www.oper= a.com/mail/