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=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:adf:e750:: with SMTP id c16mr6524685wrn.199.1565887544147; Thu, 15 Aug 2019 09:45:44 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!n5no2146362wmk.0!news-out.google.com!g3ni15475wme.0!nntp.google.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 15 Aug 2019 11:45:38 -0500 Subject: Re: The answer to "Can Ada replace FORTRAN for numerical computation? Newsgroups: comp.lang.ada References: <4ba1579b-a096-483d-8f7a-9028a419d643@googlegroups.com> <28590d5c-d5f0-4322-9aa4-e1bb92419db3@googlegroups.com> From: Norman Worth Date: Thu, 15 Aug 2019 10:45:37 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 MIME-Version: 1.0 In-Reply-To: Message-ID: X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-defCjUlqb1Zia3P2mnM+rfCFAXVj8ohIgw2MSUGJBNZLNddz4S/jCn8CWzqM6fNYy96MrxMV7Jxcenr!rl2cX4szNkjZaI8sbO8ZBfI4RzvulevWjczRYfOWmTZwgfM1SHAWME2Pn8fCporCG1djekVUP27d X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html 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.3.40 X-Original-Bytes: 2934 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Xref: reader01.eternal-september.org comp.lang.ada:57065 Date: 2019-08-15T10:45:37-06:00 List-Id: Randy Brukardt wrote: > "Lucretia" wrote in message > news:28590d5c-d5f0-4322-9aa4-e1bb92419db3@googlegroups.com... > ... >> Something like: >> >> M2 := M4 (1, 1 .. 2, 2); -- Makes a copy into the Matrix 2x2 type from a >> 4x4. > > This is no problem, of course. What is a problem is the fact that one can > assign into these things and (especially) pass them as "in out" parameters. > That causes overhead for all parameter passing of arrays, whether or not a > multidimensional slice is ever actually used (the compiler cannot assume > that array components are contiguous). > > Array slices is one of the features I would remove from "Better Ada". Most > of their utility comes from strings, and (modern) strings are not arrays in > the first place. (I'd also get rid of arrays as a built-in type, making them > a form of container.) A side-effect of that would be to get rid of the > continuing discussion of this "obvious" extension that is way too expensive > to have in Ada (or any language, for that matter). Subprograms can easily > provide the "cheap" functionality, and no one really intends to use > expensive code anyway. > > Randy. > > I agree that arrays would probably work better as containers, but array slices are very handy in a number of cases when you need to copy part of an array or restrict the view of the array. But then slices would probably work better as container functions too.