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 09:08:35 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!chcgil2-snh1.gtei.net!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!bos-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3BAB65EE.210F4F77@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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 21 Sep 2001 11:08:14 -0500 NNTP-Posting-Host: 151.168.135.96 X-Complaints-To: news@ext.ray.com X-Trace: bos-service2.ext.raytheon.com 1001088514 151.168.135.96 (Fri, 21 Sep 2001 12:08:34 EDT) NNTP-Posting-Date: Fri, 21 Sep 2001 12:08:34 EDT Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:13234 Date: 2001-09-21T11:08:14-05:00 List-Id: Jacob Sparre Andersen wrote: > safe types, I have certainly wanted something very similar > to parametrically polymorphic functions. It would make it > possible to have more extensive compile time checks, than > what is possible with Ada as it is defined today. > > An example: > > type Matrix (Left, Right : Positive) is private; > > function "*" (Left : in Matrix; > Right : in Matrix (Height => Left.Width)) > return Matrix (Width => Right.Width, > Height => Left.Height); Where are you going to put the result? If the implementation is reasonable, constraint_error will be raised when the constraints on the left side don't the constraints on the result. And if the constraints are static on both, many compilers will detect it at compile time. -- Wes Groleau http://freepages.rootsweb.com/~wgroleau