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-Thread: a07f3367d7,73cb216d191f0fef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII X-Received: by 10.66.242.197 with SMTP id ws5mr1636184pac.32.1364203147285; Mon, 25 Mar 2013 02:19:07 -0700 (PDT) Path: q9ni25772pba.1!nntp.google.com!news.glorb.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!usenet-fr.net!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 25 Mar 2013 10:19:05 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not References: <514874d3$0$6628$9b4e6d93@newsspool2.arcor-online.net> <1o60gooo8xvba$.1ei9cebb07zek$.dlg@40tude.net> <514897bd$0$6641$9b4e6d93@newsspool2.arcor-online.net> <1oqwvcemo8dha$.hevuedtz8eze.dlg@40tude.net> <14aijp8ckzahf$.1ilfm1nw6qgyt$.dlg@40tude.net> <1xg9wka6slgit.1q0leacagdeuv.dlg@40tude.net> <10cliooad0uk.1prxobehp9yr0.dlg@40tude.net> <1upbnm5cl13bs$.pzszb0e3v9zo.dlg@40tude.net> In-Reply-To: Message-ID: <5150168a$0$6559$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 25 Mar 2013 10:19:06 CET NNTP-Posting-Host: 00f401b9.newsspool4.arcor-online.net X-Trace: DXC=?ehh1@0J>IU\9P[:DUn00Q4IUKgZAYPCY\c7>ejVXTdRo=7B7 On 25.03.13 09:32, Dmitry A. Kazakov wrote: > On Sun, 24 Mar 2013 09:27:02 +0100, J-P. Rosen wrote: > >> Le 24/03/2013 09:17, Dmitry A. Kazakov a �crit : >>> Moreover, you want to tell that the behavior of an operation would depend >>> on a variable? Do I read it right? Not on the type or value it has. This is >>> how you want to deal with simple scalar types? >> Yes, the behaviour of assignment depends on the SUBTYPE of the target >> variable. > > Merely in order to warn other readers of c.l.a. It is not a variable > property and there exist cases when this matters. E.g. > > X : Integer := Positive'(-1); > > This must raise Constrant_Error, Yes. > though X as an Integer variable does not > have any constraint; Two things seem logically wrong, here, I think. 1. Ada's Standard.Integer has a constraint. Standard.Positive has a constraint that is different from Standard.Integer's constraint. Both, Integer and Positive, refer to the same Ada type, in Ada. 2. And no. Changing the situation by introducing qualified expression and representing J-P. Rosen's comment as if being about that situation (when it is not) does not kill the fact that, in Ada, a constraint error like the above one is not a type error. This has a type error, in Ada: X : Duration := Positive'(-1); So has this X : Duration := Positive'(1); If Constraint_Error is too weak for you, go ahead, rewrite the language, and really do so: If you want Positive to be a type, in Ada, and if it is easy to make it a type, in Ada---like you have outlined in just a few sentences, recently---do take the time to make the trivial adjustments to RM 3 etc, all paragraphs, add or remove paragraphs as needed, outline efforts needed for implementing, as you have done, and submit.