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-7-bit X-Google-Thread: 103376,73f15dbe4ec16d06 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-03 12:52:33 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: fjloma@andaluciajunta.es (Francisco Javier Loma Daza) Newsgroups: comp.lang.ada Subject: Re: Adding "()" operator to Ada 200X Date: 3 Jun 2003 12:52:32 -0700 Organization: http://groups.google.com/ Message-ID: <404ee0af.0306031152.4c94f89@posting.google.com> References: <1ec946d1.0306021542.58714996@posting.google.com> NNTP-Posting-Host: 62.37.141.172 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1054669953 29502 127.0.0.1 (3 Jun 2003 19:52:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 3 Jun 2003 19:52:33 GMT Xref: archiver1.google.com comp.lang.ada:38550 Date: 2003-06-03T19:52:33+00:00 List-Id: mheaney@on2.com (Matthew Heaney) wrote in message news:<1ec946d1.0306021542.58714996@posting.google.com>... > "Frank J. Lhota" wrote in message news:... > > There appears to be wide agreement that Ada 200X should include some sort of > > standard container library like Charles and PragMark. This library will > > probably include generic packages for creating and operating with dynamic > > lists and maps. One can view these kinds of collections as generalized > > arrays, and as such, it would be nice to use array notation for accessing a > > member of one of these collections. > > > [snip] > > I cannot help but think that this would be of tremendous help with whatever > > standard container library is added to Ada 200X. > > But all you've done is change the syntax. None of your suggestions > allow you to do more than is already provided by the library. > Yes, I can first make a prototype using arrays, and when a more dynamic structure is needed switch to a Single_List. If Single_List have the same syntax of an array (operator (), and some attributes), I have not to change a line of code. The same example with Unbounded_String and String .... I know that I can do generics for that purpouse, but then loosing all the syntactic richness/sugar. Providing a consistent notation/syntax for arrays and user defined containers would make the code look like better, isn't readability an Ada goal? Ada have very good support for basic types, why not have the same support for user defined types? > [snip] [snip] > If you're going to make a change in the syntax of the language, then > it has be because it allows you to do something you can't do already. Yes, I can live without that ... but then I will have to rewrite (and retest) a lot of lines of code. Having that will make more readable my code by not to worry about how every particular collection is defined. [snip] > For example, there's no way to declare an access subtype right now > that means "all the access values except null." A useful language > change would be to allow the declaration: > > type Element_Access_Base is access all Element_Type; > > subtype Element_Access is Element_Access_Base range not null; I like your proposal very much!!!