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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,UTF8 X-Google-Thread: 103376,73f15dbe4ec16d06 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-07 01:34:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.r-kom.de!fu-berlin.de!uni-berlin.de!dialin-145-254-038-040.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Adding "()" operator to Ada 200X Date: Sat, 07 Jun 2003 10:36:37 +0200 Organization: At home Message-ID: References: <4a4de33a.0306030823.cd30642@posting.google.com> <4a4de33a.0306060256.52b12d70@posting.google.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-038-040.arcor-ip.net (145.254.38.40) Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8Bit X-Trace: fu-berlin.de 1054974839 13455236 145.254.38.40 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:38783 Date: 2003-06-07T10:36:37+02:00 List-Id: Mário Amado Alves wrote: >> IMO one should first add a new set of types: "index" types. (Dmitry) > > Maybe *every* 'conceptual' type should be in the type system. > A la Smalltalk. Every conceptual type a programmer might imagine. That's the difference between ADT and non-ADT. Alas, there is no ADT for 2nd-order types (type sets like (<>), range (<>), mod (<>) etc) in Ada. That has to be changed. Another weakness is absense of supertypes. It is impossible to develop a type hierarchy before coding in a project of real size. Especially it is true for Ada as opposed to "run-once" languages. So if I want to mix String and Unbounded_String let me do it. > This includes exceptions (cf. AE'2001) and, I am not sure that exceptions should be of different types. To have classes of exceptions one just need them to be ordered in some way. Type hierarchy brings an order, but other, undesirable effects, as well. I would prefer an ordered set of exceptions of same (index) type. With index types one could do something like: IO_Errors : exception'Set := End_Error..Use_Error; ... exception when IO_Errors => > yes, ranges. > It always bugged me what is the 'return type' of the Range attribute. > I think it's the only attribute that does not return a type proper. > Even exceptions and tags have their 'surrogates' in the type system. > I can see "I .. J" as sugar for "Range (From => I, To => J)". > ".." as an operator! And "|" as an operator! Then somebody (me?) whould ask for: Prime_Numbers : Integer'Set := 1 | 3 | 5 | 7 | 11 | 13; type Primes is Integer Prime_Numbers; -- (:-)) > But this be too much to prepare for Ada 200Y :-( > Ada 20XX maybe, if we're still around :-) -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de