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,bf03d731a6ef511f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!k18g2000prf.googlegroups.com!not-for-mail From: Jerry Newsgroups: comp.lang.ada Subject: Re: Copying rows in a two dimensional array. Date: Tue, 2 Feb 2010 14:23:25 -0800 (PST) Organization: http://groups.google.com Message-ID: <62eb2ccd-b3ff-4a8a-ab80-21c5bb0a0ef4@k18g2000prf.googlegroups.com> References: <4b6637a1$0$4586$4d3efbfe@news.sover.net> NNTP-Posting-Host: 75.172.187.95 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1265149405 2318 127.0.0.1 (2 Feb 2010 22:23:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 2 Feb 2010 22:23:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k18g2000prf.googlegroups.com; posting-host=75.172.187.95; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/528.16+(KHTML, like Gecko, Safari/528.16) OmniWeb/v622.8.0,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8864 Date: 2010-02-02T14:23:25-08:00 List-Id: On Feb 2, 1:52=A0am, Jean-Pierre Rosen wrote: > Jerry a =E9crit :> I've never understood why Ada does not allow slicing i= n > > multidimensional arrays. What are the safety issues involved? And how > > is it safe to force the programmer into ad hoc methods? > > One-dimensional slices are simple and efficient. Multidimensional slices > are a can of worms. > > I guess you are thinking about rectangular slices. But why stop there? A > slice comprising the main diagonal and the diagonal above and below can > be very useful for some calculations. Or a slice which is the triangular > part of the upper half... > > AFAICT, Fortran-99 does provide this - and the syntax is so complicated > that nobody uses it. And implementation is also a nightmare. > > When designing a programming language, you have to stop at some point. > The ratio (cost of implementation) / usefulness is a good measure for > this. I think the ratio was simply to high for this feature. > > -- > --------------------------------------------------------- > =A0 =A0 =A0 =A0 =A0 =A0J-P. Rosen (ro...@adalog.fr) > Visit Adalog's web site athttp://www.adalog.fr Well, yes, I was thinking of rectangular slices. No doubt the (cost of implementation) / usefulness is high (and usage difficult) for non- rectangular parts, but that is far less common than rectangular parts. Python, Matlab/Octave, Igor Pro... all pull it off without too much hassle (although Python asks you to imagine addressing the array by the "cracks" between elements, as I recall--probably a disease of C- style counting). Jerry