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: 103376,1540032852ee6d61 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!j27g2000cwj.googlegroups.com!not-for-mail From: "Jerry" Newsgroups: comp.lang.ada Subject: Re: Why does this work? (overloads) Date: 7 Feb 2007 12:53:43 -0800 Organization: http://groups.google.com Message-ID: <1170881623.149455.139410@j27g2000cwj.googlegroups.com> References: <1170823163.681564.186260@s48g2000cws.googlegroups.com> NNTP-Posting-Host: 67.40.87.12 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1170881645 19447 127.0.0.1 (7 Feb 2007 20:54:05 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 7 Feb 2007 20:54:05 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/420+ (KHTML, like Gecko, Safari/420) OmniWeb/v607.16,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: j27g2000cwj.googlegroups.com; posting-host=67.40.87.12; posting-account=Ax24hA0AAABV39UFqUVhb0kauOuAbI3T Xref: g2news2.google.com comp.lang.ada:9092 Date: 2007-02-07T12:53:43-08:00 List-Id: Jeffrey R. Carter wrote: > Jerry wrote: > > (1) Why does the following work? > > Because Ada was designed so you can do this. > > > (2) Have I done something stupid or dangerous? > > No. > Excellent. I knew there was some reason that I was using Ada ;). > > > -- Some declarations... > > f, x, H : Real_Vector(0 .. NN - 1); > > Note that in mathematics, matrices and vectors are indexed from 1. 1 .. > NN also avoids the common error of forgetting the "- 1". > Yes, but time series are usually indexed from 0. Sometimes, the FFT of a time series is indexed from 0 and sometimes -NN/2 .. NN/2-1. When one uses a time series in a vector or matrix, conundrums obviously arise, not only in computer code but in print. I once figured out how to make Pascal let me have it both ways by declaring both types, one type indexed 0..NN-1 and the other 1..NN, and then I set a pointer of one type to an array originally declared with another type. I'm guessing that Ada doesn't allow this, however. > Because the context of overload resolution for "+" (ARM 8.6) doesn't > allow this if there is another interpretation that isn't an error. Thanks for the great explanation. Jerry