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: border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: basic question on adding 2 arrays Date: Sat, 12 Jul 2014 23:33:57 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 13 Jul 2014 06:34:00 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="ec00b5351686c67721798cbf9cd968b0"; logging-data="3909"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4vriJBkU11cp4pP+EPNlFWkN7j+H3zzY=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:7PQQhbRyuOlOY58C0B0FBZx+/Hs= Xref: number.nntp.dca.giganews.com comp.lang.ada:187554 Date: 2014-07-12T23:33:57-07:00 List-Id: On 07/12/2014 09:09 PM, Nasser M. Abbasi wrote: > > This is what I tried. But after making special > "+" to add the 2 slices of grid_type, by making > new grid_type2 which is 2 elements smaller than > grid_type, how does not tell Ada to move this > grid_type2 into grid_type since they are of > different type? Do I need another loop for this? type Base_Grid is array (Positive range <>) of Float; subtype Grid_Type is Base_Grid (1 .. Npoints); function "+" (Left : in Base_Grid; Right : in Base_Grid) return Base_Grid with Pre => Left'Length = Right'Length; Next (Next'First + 1 .. Next'Last - 1) := Next (Next'First .. Next'Last - 2) + Next (Next'First + 2 .. Next'Last); -- Jeff Carter "I would never want to belong to any club that would have someone like me for a member." Annie Hall 41