From: Erlo Haugen <_elh_@_tema_._com_>
Subject: Re: types and non-contigous ranges
Date: Fri, 27 Feb 2004 08:53:03 +0100
Date: 2004-02-27T08:53:03+01:00 [thread overview]
Message-ID: <403ef778$0$128$edfadb0f@dread11.news.tele.dk> (raw)
In-Reply-To: <vg5s30h8fihtrvc0k5kqu2nnhuc7u09nar@4ax.com>
Dmitry A. Kazakov skrev:
> On Thu, 26 Feb 2004 15:17:38 +0100, Erlo Haugen <_elh_@_tema_._com_>
> wrote:
>
>
>>Hello everyone,
>>what is the easiest way to define a (sub)type consisting of ranges and
>>single values?
>
>
> Only ranges are allowed.
>
>
>>Let me give an example:
>>
>>I want a type, based on character, that contains 'A'..'Z' and '0'..'9'
>>and some single characters like '�','�' and '�'.
>>
>>subtype Valid_Characters is character range 'A'..'Z' ????? and what then??
>>
>>
>>Do I really have list all the values?
>
>
> Take a look at Ada.Strings.Maps and Strings.Maps.Constants. They
> provide sets of characters, operations on them and useful constant
> sets like Alphanumeric_Set etc. I think that
>
> Whatsoever : constant Character_Set :=
> Decimal_Digit_Set or
> To_Set (Character_Range'('A', 'Z')) or
> To_Set ('�') or
> To_Set ('�') or
> To_Set ('�');
>
> is what you are looking for.
I want to use the set/type like this:
My_array : array[Valid_Characters] of something;
That excludes the character set, I guess.
--
Erlo
-----
Remove underscores from mail address.
The statements and opinions are mine and does not
neccesarily reflect those of my employers
next prev parent reply other threads:[~2004-02-27 7:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-26 14:17 types and non-contigous ranges Erlo Haugen
2004-02-26 15:52 ` Jacob Sparre Andersen
2004-02-27 7:55 ` Erlo Haugen
2004-02-27 13:00 ` Jacob Sparre Andersen
2004-02-27 13:21 ` Erlo Haugen
2004-02-27 13:58 ` Character encoding (Was: types and non-contigous ranges) Jacob Sparre Andersen
2004-02-26 16:07 ` types and non-contigous ranges Dmitry A. Kazakov
2004-02-27 7:53 ` Erlo Haugen [this message]
2004-02-27 23:59 ` Randy Brukardt
2004-03-01 8:50 ` Erlo Haugen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox