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,ffc9e2fe760c58fd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newspeer.monmouth.com!nntp.abs.net!news.abs.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Records that could be arrays References: <_DiLf.19641$HU.2213@trnddc04> From: Stephen Leake Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:KSlgpPZR+L4+SQ8ZGjOgLAJF1JU= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 24 Feb 2006 05:19:18 -0500 NNTP-Posting-Host: 66.159.65.1 X-Complaints-To: abuse@toad.net X-Trace: news.abs.net 1140776366 66.159.65.1 (Fri, 24 Feb 2006 05:19:26 EST) NNTP-Posting-Date: Fri, 24 Feb 2006 05:19:26 EST Xref: g2news1.google.com comp.lang.ada:3124 Date: 2006-02-24T05:19:18-05:00 List-Id: Justin Gombos writes: > On 2006-02-23, tmoran@acm.org wrote: >> But with >> type Rows is new Local_Float; >> type Cols is new Local_Float; >> the compiler's type checking can point out such errors. In that case, >> of course, you have to use a record > > Sure, my rule wouldn't apply there because we're no longer talking > about a composite of a single element type. > > Cohen uses x,y coodinates of different types as an example of over > typing. I'm kind of on the fence. I've been declaring every > dimension within a coordinate system to have the same element type > because it seems to be more of a hinderance than a benefit to seperate > them. The question is whether y is a function of x, Or if you want the Cartesian magnitude: sqrt (x**2 + y**2). Or any other function that involves x and y in a single expression. Like rotation: Rotated_Point := (a * Point (x) + b * Point (y), c * Point (x) + d * Point (y)); > which can't always be answered when the type comes into existence. If it's a _point_, we already know about such things. If it's a genuinely new type, yes, it might be unclear. -- -- Stephe