comp.lang.ada
 help / color / mirror / Atom feed
From: Wes Groleau <wwgrol@sparc01.ftw.rsc.raytheon.com>
Subject: Re: Parametrically polymorphic operations (Was: Safe C++)
Date: Fri, 21 Sep 2001 13:43:44 -0500
Date: 2001-09-21T13:43:44-05:00	[thread overview]
Message-ID: <3BAB8A60.F5F66059@sparc01.ftw.rsc.raytheon.com> (raw)
In-Reply-To: 3BAB7537.BC7ED73D@nbi.dk



Jacob Sparre Andersen wrote:
>
> For example in:
> 
>    Result : Matrix (Width => 4, Height => 4);
> 
> > If the implementation is reasonable, constraint_error
> > will be raised when the constraints on the left side don't
> > the constraints on the result.
> 
> The implementation of my favourite Ada compiler or the
> implementation of function "*"?

Any conforming compiler.  To continue your example:

  Result := Matrix_A * Matrix_B;

If the function returns a four by five matrix, constraint_error
results.  This is of course at RUN-TIME though.  However, IF the
compiler is able to determine at compile time that this WILL be
the case it is allowed to issue a warning and many will.  However,
it is rare that this can be determined at compile time.

For that reason, your extension would be very useful in a minority
of cases, where the bounds of all three matrices are known and
the body of "*" is not.  This is a big enough minority that
I'd like to see it evaluated for the next revision.  But there
may be other good reasons for avoiding it.

You may be able to do such a thing statically in Eiffel.

-- 
Wes Groleau
http://freepages.rootsweb.com/~wgroleau



  reply	other threads:[~2001-09-21 18:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-18 19:45 Safe C++ Richard Riehle
2001-09-19 14:38 ` Brian Rogoff
2001-09-19 15:52   ` Chad Robert Meiners
2001-09-19 17:43     ` Brian Rogoff
2001-09-19 21:38       ` Chad R. Meiners
2001-09-20  3:38         ` Brian Rogoff
2001-09-20 11:52           ` Pat Rogers
2001-09-20 16:01             ` Brian Rogoff
2001-09-20  8:22         ` Colin Paul Gloster
2001-09-20 13:45           ` Chad R. Meiners
2001-09-20 21:03             ` codesavvy
2001-09-20 11:37         ` Parametrically polymorphic operations (Was: Safe C++) Jacob Sparre Andersen
2001-09-20 11:41           ` Lutz Donnerhacke
2001-09-20 12:27             ` Jacob Sparre Andersen
2001-09-20 15:49           ` Brian Rogoff
2001-09-21  9:24             ` Jacob Sparre Andersen
2001-09-20 16:22           ` Dmitry A. Kazakov
2001-09-21 16:08           ` Wes Groleau
2001-09-21 17:13             ` Jacob Sparre Andersen
2001-09-21 18:43               ` Wes Groleau [this message]
2001-09-20  2:41       ` Safe C++ David Botton
2001-09-20  2:39   ` David Botton
2001-09-20  3:21     ` Brian Rogoff
2001-09-20 12:43       ` David Botton
2001-09-25 14:21   ` Region-based mem mgmt [was: Re: Safe C++] Tucker Taft
2001-09-25 14:46     ` Tucker Taft
replies disabled

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