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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5556ca7de188d5ef X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-17 07:56:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!hub1.nntpserver.com!newsfeed01.sul.t-online.de!t-online.de!newsfeed.hanau.net!news-fra1.dfn.de!news.netuse.de!news-FFM2.ecrc.net!news.iks-jena.de!lutz From: lutz@iks-jena.de (Lutz Donnerhacke) Newsgroups: comp.lang.ada Subject: Re: Multidimensional array vs. array of array Date: Mon, 17 Dec 2001 15:56:28 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <40wR7.34446$ER5.389337@rwcrnsc52> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1008604588 6488 217.17.192.37 (17 Dec 2001 15:56:28 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Mon, 17 Dec 2001 15:56:28 +0000 (UTC) User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.lang.ada:18009 Date: 2001-12-17T15:56:28+00:00 List-Id: * Mark Lundquist wrote: >"Lutz Donnerhacke" wrote in message >> How does a skilled Ada programmer define a return type containing a >> multidimensional array? Of course, the simple solution works: >> >> type Equations is array (Rows range <>, Columns range <>) of Number; >> type Workspace (row : Rows; col : Columns) is record >> eqs : Equations (Rows'First .. row, Columns'First .. col); >> ... some more stuff ... >> end record; >> function Init_Workspace return Workspace; >> >> But this approach fails miserably on extracting a single row from the >> result as well as on construction the result in a recursive function. > >Would it help you to just define a distinct type to represent a row in >isolation, but keep your matrix as defined above (i.e. not in terms of >composition of the row type)? After returning the Workspace in order to define a unconstrained variables, it is possible.