Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: Generic war...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 15 Topic 5759 of 5966
Post > Topic >>

Re: Generic warning

by Robert A Duff <bobduff@[EMAIL PROTECTED] > Jun 18, 2008 at 11:10 AM

"Dmitry A. Kazakov" <mailbox@[EMAIL PROTECTED]
> writes:

> On Wed, 18 Jun 2008 14:32:28 +0000, Sébastien Morand wrote:
>
>>> (Newbie qiestion, coming from VHDL, halfway through the Barnes book)
>>> 
>>> Can you not create a subtype of Positive to reflect that, and declare
>>> both the array and index using that subtype?
>> 
>> I can't create a subtype using a parameter.
>
> No, no, you mean a *type*.
>
>> generic
>> 	Order: Positive;
>> package Test is
>> 	--  Can't work since Order is not defined at compile time
>> 	type MyType is range 1 .. Order;
>
> This would be a type. But you do can create a subtype:
>
>    subtype Index is range 1..Order; -- This is OK
>
> Subtypes can be dynamically constrained.

Yes.  You can also create a new type:

type Index is new Positive range 1..Order;

- Bob
 




 15 Posts in Topic:
Generic warning
=?ISO-8859-1?Q?S=E9bastie  2008-06-17 16:44:10 
Re: Generic warning
"Dmitry A. Kazakov&q  2008-06-17 19:17:01 
Re: Generic warning
=?ISO-8859-1?Q?S=E9bastie  2008-06-17 18:33:42 
Re: Generic warning
"Dmitry A. Kazakov&q  2008-06-17 21:04:38 
Re: Generic warning
=?ISO-8859-1?Q?S=E9bastie  2008-06-18 08:41:31 
Re: Generic warning
Brian Drummond <brian_  2008-06-18 15:16:42 
Re: Generic warning
=?ISO-8859-1?Q?S=E9bastie  2008-06-18 14:32:28 
Re: Generic warning
"Dmitry A. Kazakov&q  2008-06-18 16:42:23 
Re: Generic warning
Robert A Duff <bobduff  2008-06-18 11:10:29 
Re: Generic warning
"Dmitry A. Kazakov&q  2008-06-18 17:25:24 
Re: Generic warning
"Jeffrey R. Carter&q  2008-06-17 18:20:04 
Re: Generic warning
=?ISO-8859-1?Q?S=E9bastie  2008-06-18 08:55:39 
Re: Generic warning
"Ed Falis" <  2008-06-18 14:39:14 
Re: Generic warning
"Ed Falis" <  2008-06-18 15:38:01 
Re: Generic warning
"Dmitry A. Kazakov&q  2008-06-18 19:04:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 16:59:09 CST 2008.