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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: how to copy complete column (or row) of matrix to another? Date: Mon, 2 Oct 2017 18:08:57 -0500 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Mon, 2 Oct 2017 23:08:59 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="19282"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: news.eternal-september.org comp.lang.ada:48295 Date: 2017-10-02T18:08:57-05:00 List-Id: "Lucretia" wrote in message news:e7eb0977-c449-4d52-8010-72df7c261e0f@googlegroups.com... >I agree that multi-dimensional array slices should be supported. One >of the tenet's of Ada is to leave the implementation of things up to the >compiler, because it knows how best to do it, e.g. parameter passing. > >I asked about it here, >https://groups.google.com/d/msg/comp.lang.ada/L9XiRrjm3B0/cXfKlQ9-AwAJ >and the response was, it's not going to happen due to a slice being a name >as Randy mentions, >but it's not a request to speed up the assignment, it's just syntactic >sugar to aid readability, >another of Ada's tenets. Sigh. The problem is that supporting that would slow down ALL array assignments to parameters, regardless of whether or not the 2-d slices are used. Every such assignment would have to be element at a time, because there would be no way to determine (within the subprogram) whether or not some slices were used that makes the array non-contiguous. It also would make array indexing operations on such parameters much more expensive, for the same reason. Use of matrixes is thought to be common enough that such a performance hit (on code *not* using slices) is unacceptable. This is known as a "distributed overhead", where the existence of a feature makes code that doesn't use it more expensive. Randy.