From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: Incorrect error?
Date: Mon, 18 Jul 2011 03:40:59 -0700 (PDT)
Date: 2011-07-18T03:40:59-07:00 [thread overview]
Message-ID: <04f4f840-4ea5-407b-8eb7-1f4016ab4e13@d1g2000yqm.googlegroups.com> (raw)
In-Reply-To: Pine.LNX.4.64.1107181119040.1340@medsec1.medien.uni-weimar.de
Overloading in this way might be seen as unfortunate.
> Ada.Numerics.Generic_Real_Arrays actually provides both:
>
> function "*" (Left, Right : Real_Vector) return Real'Base;
> function "*" (Left, Right : Real_Vector) return Real_Matrix;
So if you have three vectors, what should A * B * C mean? Even with
parentheses, it's awkward to read. Now image we have a third function
function "*" (Left, Right : Real_Vector) return Real_Vector;
BTW: What would such a function return for vectors of less or more
than 3 dimensions?
Why is 'Base the return value? You might instantiate the package with
a constrained subtype of Float. 'Base is the unconstrained range. Thus
as long as you stay in the base range, the operators will not
propagate exceptions.
next prev parent reply other threads:[~2011-07-18 10:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-18 8:47 Incorrect error? ldries46
2011-07-18 9:45 ` stefan-lucks
2011-07-18 10:10 ` Georg Bauhaus
2011-07-18 11:46 ` ldries46
2011-07-18 10:40 ` AdaMagica [this message]
2011-07-18 12:39 ` Dmitry A. Kazakov
2011-07-18 12:45 ` stefan-lucks
2011-07-18 13:24 ` stefan-lucks
2011-07-18 10:39 ` Nicholas Collin Paul de Glouceſter
2011-07-18 15:58 ` Adam Beneschan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox