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,61e9062c1f23b9d5 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.stueberl.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Reconsidering assignment From: Georg Bauhaus In-Reply-To: <1v0wjynus2uj6$.b4qm8649j38o$.dlg@40tude.net> References: <1181165630.012508.55290@i38g2000prf.googlegroups.com> <19fxsxv1god43$.1pqq8vgfu2itn$.dlg@40tude.net> <1181428673.148991.76570@p77g2000hsh.googlegroups.com> <1181596329.198235.320830@w5g2000hsg.googlegroups.com> <1v0wjynus2uj6$.b4qm8649j38o$.dlg@40tude.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1181640696.5705.3.camel@kartoffel> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Date: Tue, 12 Jun 2007 11:31:37 +0200 Organization: Arcor NNTP-Posting-Date: 12 Jun 2007 11:31:35 CEST NNTP-Posting-Host: 822ecaf7.newsspool3.arcor-online.net X-Trace: DXC=KDcKU7c[cdam7>ihJR;B_cMcF=Q^Z^V3h4Fo<]lROoRaFl8W>\BH3YbG]f>Z2[06EhN[Woo X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:16168 Date: 2007-06-12T11:31:35+02:00 List-Id: On Tue, 2007-06-12 at 10:31 +0200, Dmitry A. Kazakov wrote: > On Mon, 11 Jun 2007 14:12:09 -0700, Maciej Sobczak wrote: > > procedure P(X, Y : Real) with X*X + Y*Y <= 1; > > procedure P(X, Y : Real); > > > > The idea was to have some assistance from the language for the proper > > selection of overloaded P (one is for arguments that fall withing the > > unit circle, and the other is for the rest). > > This cannot work because overloading resolution happens at compile-time, > while the conditions of matching, in your case are general run-time > expressions. As you explain further below, this is about template choice computation by the compiler, I think. > Yet another point: P is a polymorphic subprogram. Various overloading are > implementations of. The condition clause controls the choice. Does not it > remind you anything? Make Real a class! Close to this is the Eiffel principle of using one name one and only name for one entity, no overloading at all; if polymorphism is needed, use overriding. What about argument pattern matching?