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-7-bit Path: g2news1.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!209.197.12.246.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!news-out.readnews.com!transit3.readnews.com!panix!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Copying rows in a two dimensional array. Date: Tue, 09 Feb 2010 09:33:53 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <12ezqn0wq0lmm$.s7nr5aueiwa4$.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1265726021 24817 192.74.137.71 (9 Feb 2010 14:33:41 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 9 Feb 2010 14:33:41 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:cnl8OZ5HgR60LIs+PsLqCjHaH/A= Xref: g2news1.google.com comp.lang.ada:9034 Date: 2010-02-09T09:33:53-05:00 List-Id: "(see below)" writes: > On 08/02/2010 21:20, in article wccd40fpgpu.fsf@shell01.TheWorld.com, > "Robert A Duff" wrote: > >> It's trivial if you only want slices as R-values. >> And anyway, slices as L-values don't really work: > > I can't agree. I have this code: > > procedure FFT_to_HWT (FFTCs : in complex_array; ... > HWT_tree : out complex_array; ...) is > ... > iFFTCs : complex_array (1..f(FFTCs'length)); > begin > ... > iFFTCs(1..nr_bins) := FFTCs(first_bin..last_bin); > iFFTCs(nr_bins+1..iFFT_size) := (others => (0.0,0.0)); > inverse_FFT(iFFTCs(1..iFFT_size)); > ... > HWT_tree(next_HWTC..next_HWTC+iFFT_size-1) := iFFTCs(1..iFFT_size); > ... > end FFT_to_HWT; > > I think that using slices as L-values as well as R-values helps to make this > a lot clearer than it otherwise would be, and probably faster as well. "Clearer"? Yes, I agree. "A lot clearer"? I don't know -- something like: Copy_Slice(iFFTCs, ...); doesn't seem so horrible. - Bob