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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f30ef262af690ce0 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!p25g2000hsf.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: numbers as 'generics' parameters Date: Fri, 16 May 2008 13:52:23 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <482dd91a$1_3@news.bluewin.ch> NNTP-Posting-Host: 85.1.243.72 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1210971144 32487 127.0.0.1 (16 May 2008 20:52:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 16 May 2008 20:52:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p25g2000hsf.googlegroups.com; posting-host=85.1.243.72; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:119 Date: 2008-05-16T13:52:23-07:00 List-Id: On 16 Maj, 20:57, Gautier wrote: > generic > N: Integer; > package Fixed_size_vectors is > Vector: array(1..N) of Float; I guess: type Vector is array (1..N) of Float; > end; How to write an operation that ensures *at compile time* that its two parameters are Fixed_size_vectors of equal N? Declare it in a child package? Is there any other option? Similar question can be asked for (un)constrained and discriminated types. What are the options for such an operation? -- Maciej Sobczak * www.msobczak.com * www.inspirel.com