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: 103376,6f580d48a3449630,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Constraints in extended return Date: Sat, 19 Mar 2011 10:42:45 +0000 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="24456"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+I1ehYxjtqZbg2JJLdqoHq8XRKAwAbUk=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:4RcjdYGQmcPmq9FvD3brf5A89gM= sha1:inE3ourUdztP6CfUGjBBEWDOdm4= Xref: g2news2.google.com comp.lang.ada:19285 Date: 2011-03-19T10:42:45+00:00 List-Id: This code transposes a matrix: function Transpose (M : Complex_Matrix) return Complex_Matrix is begin return Result : Complex_Matrix (M'Range (2), M'Range (1)) do for J in M'Range (1) loop for K in M'Range (2) loop Result (K, J) := M (J, K); end loop; end loop; end return; end Transpose; This is all very well for providing a value where no constraint is otherwise imposed, for example as an actual in a subprogram call, but what about the case where there is a prior constraint? Input : Complex_Matrix (1 .. 2, 11 .. 12); Output : Complex_Matrix (1 .. 2, 1 .. 2); begin Input := (...); Output := Transpose (Input); Is there any way for the extended return to determine the constraints of the 'target'? I suspect not, but the language in RM6.5 is deep.