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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,60e2922351e0e780 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-08 22:49:06 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 09 Nov 2003 00:49:04 -0600 Date: Sun, 09 Nov 2003 01:49:03 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Clause "with and use" References: <3FA50083.10709@noplace.com> <3FA777E9.4030605@noplace.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.34.214.193 X-Trace: sv3-oENpYTABCOqiOf7IoAfG0gxMs+AqUdEOtKVv70pnW+UeFCxqpVqjq1jgAWXY0ARNURjSWz9UTbjMeiL!YXsdXZDZtW6r3AoUwCr0PnAWOGG8aW3zua/Dch9nniqDr3e4yEBAeqcd4mKg7Q== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:2271 Date: 2003-11-09T01:49:03-05:00 List-Id: Martin Dowie wrote: >> A more interesting question is that >>obviously if A in A := B * C; is indefinite, you want it to get the >>"right" constraint from the "*" function. But what if the return value >>is declared indefinite? Can it take its constraints from the target > > object? > > Sorry, it is v.late, I'm not sure what you mean here... Do you mean > 'what if "B" and "C" are functions returning indefinite values?' No, you have to think about this in the sequence I stated: A: Matrix := B * C; -- In this case A is not constrained and must get its constraint from -- the function return value. This is expected and should be allowed. A: Matrix(1..4;1..4) := B * C; -- Here we have a constrained object, now let's look inside the -- function: function "*" (L,R: Matrix) return Matrix is Result: return Maxtrix := (others => others => 0.0); -- here we have a result--with whatever the declaration syntax is -- is this declaration--where the bounds come from the target. -- Should this be legal? -- In the non-limited case, the answer seems to be "What are you, -- nuts? Of course you can't do that. But where the type of the -- result is limited, the answer isn't so clear. The result is -- going to have to be "built in place" in storage passed by the -- caller. Being able to query the attributes of the result -- object is not so crazy in that case. But do we want the rules -- to differ based on whether or not the object is limited? -- Remember the view of the type at the place of the call could be -- different from inside the function. -- My answer is that any rules are going to have to depend on the -- status of the type at the point of the function declaration. -- But that rule starts to produce other anomalies. A rule that -- peeks inside the private part of a package with a function -- limited return type is possible. begin some code; end "*"; -- Robert I. Eachus 100% Ada, no bugs--the only way to create software.