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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,1b78051e65d4576a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-26 07:57:26 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!tar-atanamir.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: types and non-contigous ranges Date: Thu, 26 Feb 2004 17:07:12 +0100 Message-ID: References: <403e001b$0$144$edfadb0f@dread11.news.tele.dk> NNTP-Posting-Host: tar-atanamir.cbb-automation.de (212.79.194.116) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de 1077811044 54743026 I 212.79.194.116 ([77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:5865 Date: 2004-02-26T17:07:12+01:00 List-Id: 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. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de