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,9ce095aba33fe8d0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Negative float problem Date: 02 Nov 2005 08:32:21 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1130351574.313991.229420@g14g2000cwa.googlegroups.com> <10mspnley7gzu$.1swtj67sv0ldr$.dlg@40tude.net> <38tcpxwxfigo$.18ysjyp9ml92c$.dlg@40tude.net> <2ybc7t4au7g$.166dxwfrds1so$.dlg@40tude.net> <18nrnlg9zzl5a.k8rl3ajwauqi.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1130938341 14110 192.74.137.71 (2 Nov 2005 13:32:21 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 2 Nov 2005 13:32:21 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:6119 Date: 2005-11-02T08:32:21-05:00 List-Id: "Dmitry A. Kazakov" writes: > On Wed, 02 Nov 2005 10:04:21 +0100, Maciej Sobczak wrote: > > > Dmitry A. Kazakov wrote: > > > >> package A is > >> type Foo is ...; > >> function "+" (Left, Right : Foo) return Foo; > >> end A; > >> ------------------- > >> package A.B is > >> X : Foo; > >> function "+" (Left, Right : Foo) return Foo; > >> end A.B; > >> ------------------ > >> with A.B; > >> ... > >> A.B.X + A.B.X -- BOOOOM! > > > > With ADL, I would expect it to call A."+". > > Which perfectly illustrates why there should be no such thing as ADL. > Exactly to prevent making the above legal with the meaning A."+". Well, perhaps, but the above example is confusing with the current rules, too. If you say "use type A.Foo", you get one "+", when you might expect to get the other. Even worse, add this to A.B: "subtype Foo is A.Foo", and then say "use type A.B.Foo" -- you might be surprised to get A."+". I think the answer is a coding convention: If you want to declare an operator, always make it a primitive of the interesting type involved. I'm not sure whether that could reasonably be a language rule... - Bob