comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: overriding "*", was Re: What's the ICFP Programming contest?
Date: Tue, 1 Jul 2003 15:52:46 -0500
Date: 2003-07-01T15:52:46-05:00	[thread overview]
Message-ID: <vg3t25qrukd0b@corp.supernews.com> (raw)
In-Reply-To: mq9Ma.675$C36.1204@rwcrnsc51.ops.asp.att.net

tmoran@acm.org wrote in message ...
>For the contest I needed to override normal fixed point multiply and
>divide, so I declared
>  type Root_Numbers is delta ...
>  type Numbers is new Root_Numbers;
>  function "*"(Left, Right : Numbers) return Numbers;
>  A, B, C : Numbers;
>and tried to use it in formulas like
>  C := Numbers(A * B);
>But a compiler said the "*" was ambiguous between my function and
Standard.
>It seems to me I overrode, and thus hid, Standard."*", no?
>  p.s. I did manage to write a program that successfully drove the
first 5
>out of 9 race tracks.  It gets really lost though in the maze-like
ones.
>The "programming" contest really becomes an "algorithm" contest there.

That's a well-known feature of Ada 95 (and it is incompatible with Ada
83). The problem is that you can't hide the mixed fixed point multiply
(any fixed * any fixed -> universal fixed), so it is ambiguous anywhere
other than in the children of your fixed point package.

The ARG has looked at this problem several times, and so far it has
defied solution. Tucker announced that he had solved it when I was
talking to him after the Toulouse meeting, but whether that is really
true (and whether we can live with the incompatibility) is yet to be
seen.

                 Randy.





  reply	other threads:[~2003-07-01 20:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-26  1:30 What's the ICFP Programming contest? tmoran
2003-06-26  8:24 ` Preben Randhol
2003-06-27 20:37   ` Michael Erdmann
2003-06-28  0:21     ` tmoran
2003-06-28  7:33       ` Michael Erdmann
2003-06-29  6:47         ` Hyman Rosen
2003-06-29 22:37           ` tmoran
2003-07-01  5:58             ` overriding "*", was " tmoran
2003-07-01 20:52               ` Randy Brukardt [this message]
2003-07-02 17:10                 ` tmoran
2003-07-02 18:13                   ` Randy Brukardt
2003-07-03  7:55               ` Robert I. Eachus
2003-07-04  7:01                 ` Robert I. Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox