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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Negative float problem Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1130351574.313991.229420@g14g2000cwa.googlegroups.com> Date: Mon, 31 Oct 2005 15:20:06 +0100 Message-ID: <10mspnley7gzu$.1swtj67sv0ldr$.dlg@40tude.net> NNTP-Posting-Date: 31 Oct 2005 15:20:07 MET NNTP-Posting-Host: c7e93a19.newsread2.arcor-online.net X-Trace: DXC=n7g\9dGMWn?D9BSA]lXA5UN1o On Mon, 31 Oct 2005 10:46:06 +0100, Maciej Sobczak wrote: > Dmitry A. Kazakov wrote: > >>>So - why not having ADL in Ada? :) >> >> C++ compiler matches things bottom up. This is not sufficient for Ada which >> represents a more general case. So ADL might be more problematic in Ada. > > I don't really understand this. Basically you want to deduce the operations from their operands. So the operands should be known before you are going to match the alternatives. The idea of ADL is that operands determine the matching context. It works good only if there is a very limited number of such contexts to consider. Not that a compiler could not crunch that. The problem is that nobody would be able to describe the game rules, understand them, and even less, predict the outcome. >> Further, parameterless function call is >> indistinguishable from name. > > So? ADL is about *arguments* and does not apply to parameterless > functions at all. But in A.B.C (argument) you do not know whether B is a package, function name or variable. > It is there so that "things work as expected", which > in particular applies to the original problem in this thread. There is > an operator which does not work "as expected". ADL seems to be a solution. Some legal code might become illegal, because some invisible before operations would contribute to overloading. [ Of course one can "stratify" visibility rules to make it a total mess.] >> Personally, I'd prefer simpler visibility rules and more consistency checks >> preventing operation hiding, so than one could just "use" almost >> everything. Ada's advantage of having packages instead of wild insertions >> through #include, should be better used, IMO. > > I don't understand this. Could you please elaborate? > (I'm learning Ada.) People tend to avoid "use" because it leads to ambiguities and mutual hiding. There are few ways to manage the visibility. Trivial things require a lot of acrobatics, like combining specifications of two packages into a third pure package. That is the root of evil. The language should be more "use" friendly. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de