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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a59300e1cca1082c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-21 11:44:06 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!cyclone.swbell.net!bos-service1.ext.raytheon.com!bos-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3BAB8A60.F5F66059@sparc01.ftw.rsc.raytheon.com> From: Wes Groleau Reply-To: wwgrol@sparc01.ftw.rsc.raytheon.com X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en,es-MX,es,pt,fr-CA,fr MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Parametrically polymorphic operations (Was: Safe C++) References: <3BA7A45D.186EE27A@adaworks.com> <20010919072904.O10277-100000@shell5.ba.best.com> <20010919102107.L4954-100000@shell5.ba.best.com> <9ob2u6$2r4l$1@msunews.cl.msu.edu> <3BA9D515.1E6C7A49@nbi.dk> <3BAB65EE.210F4F77@sparc01.ftw.rsc.raytheon.com> <3BAB7537.BC7ED73D@nbi.dk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 21 Sep 2001 13:43:44 -0500 NNTP-Posting-Host: 151.168.135.96 X-Complaints-To: news@ext.ray.com X-Trace: bos-service2.ext.raytheon.com 1001097845 151.168.135.96 (Fri, 21 Sep 2001 14:44:05 EDT) NNTP-Posting-Date: Fri, 21 Sep 2001 14:44:05 EDT Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:13241 Date: 2001-09-21T13:43:44-05:00 List-Id: 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