comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: numbers as 'generics' parameters
Date: Sat, 17 May 2008 09:29:34 -0700 (PDT)
Date: 2008-05-17T09:29:34-07:00	[thread overview]
Message-ID: <9e99c5cd-fd94-4a38-89fd-681c0372b7ad@y38g2000hsy.googlegroups.com> (raw)
In-Reply-To: 1g4p2jgvi3k8j.1j2xk6p9ws3a2.dlg@40tude.net

On 17 Maj, 09:47, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
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



  reply	other threads:[~2008-05-17 16:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-16 17:26 numbers as 'generics' parameters jhc0033
2008-05-16 17:55 ` Adam Beneschan
2008-05-16 19:12   ` John B. Matthews
2008-05-16 18:34 ` jimmaureenrogers
2008-05-16 18:57 ` Gautier
2008-05-16 20:52   ` Maciej Sobczak
2008-05-16 23:09     ` Peter C. Chapin
2008-05-17  7:47     ` Dmitry A. Kazakov
2008-05-17 16:29       ` Maciej Sobczak [this message]
2008-05-17 17:34         ` Dmitry A. Kazakov
2008-05-18 13:58           ` Maciej Sobczak
2008-05-18 14:52             ` Dmitry A. Kazakov
2008-05-18 20:37               ` Maciej Sobczak
2008-05-19  9:02                 ` Dmitry A. Kazakov
2008-05-19  5:16             ` Ivan Levashew
2008-05-19  8:26               ` Maciej Sobczak
2008-05-16 20:22 ` Jeffrey R. Carter
2008-05-21 15:32   ` Robert A Duff
replies disabled

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