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!news2.google.com!postnews.google.com!y38g2000hsy.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: numbers as 'generics' parameters Date: Sat, 17 May 2008 09:29:34 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9e99c5cd-fd94-4a38-89fd-681c0372b7ad@y38g2000hsy.googlegroups.com> References: <482dd91a$1_3@news.bluewin.ch> <1g4p2jgvi3k8j.1j2xk6p9ws3a2.dlg@40tude.net> NNTP-Posting-Host: 85.3.228.71 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1211041774 4046 127.0.0.1 (17 May 2008 16:29:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 17 May 2008 16:29:34 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y38g2000hsy.googlegroups.com; posting-host=85.3.228.71; 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:162 Date: 2008-05-17T09:29:34-07:00 List-Id: On 17 Maj, 09:47, "Dmitry A. Kazakov" wrote: > > Similar question can be asked for (un)constrained and discriminated > > types. What are the options for such an operation? > > You do it declaring a subtype, that constraints the discriminant or bounds. I see - however, this requires the declaration of a constrained subtype. What about this: procedure P (X : in String; Y : in String); This procedure accepts two strings of any length - and they can have different lengths. What about limiting this and allowing the user to call P only with two strings of the same length? Declaring a constrained subtype would fix the length to the one used in type declaration. Is it possible to define P in a way that allows strings of any length, but equal? -- Maciej Sobczak * www.msobczak.com * www.inspirel.com