comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Adding "()" operator to Ada 200X
Date: Sat, 07 Jun 2003 10:36:37 +0200
Date: 2003-06-07T10:36:37+02:00	[thread overview]
Message-ID: <bbs81m$cqjs4$1@ID-77047.news.dfncis.de> (raw)
In-Reply-To: 4a4de33a.0306060256.52b12d70@posting.google.com

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



      parent reply	other threads:[~2003-06-07  8:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-02 16:35 Adding "()" operator to Ada 200X Frank J. Lhota
2003-06-02 23:42 ` Matthew Heaney
2003-06-03 14:59   ` Frank J. Lhota
2003-06-03 15:09     ` Frank J. Lhota
2003-06-03 16:04     ` Martin Krischik
2003-06-04 17:28       ` Matthew Heaney
2003-06-04 18:21         ` Frank J. Lhota
2003-06-05  1:15           ` Robert I. Eachus
2003-06-05 14:59             ` Frank J. Lhota
2003-06-05 17:25             ` Matthew Heaney
2003-06-03 20:24     ` Randy Brukardt
2003-06-03 19:52   ` Francisco Javier Loma Daza
2003-06-03  2:56 ` Fionn mac Cuimhaill
2003-06-03 14:02   ` Matthew Heaney
2003-06-03 16:23   ` Mário Amado Alves
2003-06-05 19:02     ` Dmitry A. Kazakov
2003-06-06 10:56       ` Mário Amado Alves
2003-06-06 16:55         ` Chad R. Meiners
2003-06-06 19:01         ` Frank J. Lhota
2003-06-09 14:15           ` Matthew Heaney
2003-06-07  8:36         ` Dmitry A. Kazakov [this message]
replies disabled

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