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.7 required=5.0 tests=BAYES_00,INVALID_MSGID, PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8f8cea8602e61aba X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: The Red Language Date: 1997/09/13 Message-ID: #1/1 X-Deja-AN: 272096485 References: <340E2DC5.25D7@worldnet.att.net> Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-09-13T00:00:00+00:00 List-Id: In article , bobduff@world.std.com (Robert A Duff) wrote: >You can declare variables locally within any sequence of statements >without introducing a declare block. Funny you should mention that. Ada wisely creates an implicit block for statement lists in if statement alternatives and case statement alternatives, etc, but, interestingly, doesn't extend implicit block-ness to objects declared there. >Weaker overload resolution rules (than Ada). Eg no top-down resolution, >except in limited cases. Function result types not considered for >resolution. I like the Ada choice. Why do so many language designers think less of function return types? > >More user-defineable stuff. Like literal notation, array indexing and >slicing notation, dot-selection notation, etc. This is something I'd still like to see added to Ada: the ability to define an index operator and a slice-operator for abstract data types, even if its application can only appear on the RHS of assignment. Of course, I'd really like to see name expressions allowed on the LHS. So we could say Top (Stack) := 5; or, if they really wanted to make me happy, adding user-definable selectors, ie type Stack is private; selector Stack.Top return Integer; so I could say Stack.Top := 5; It would be cool too to be able use an instantiation of unchecked_conversion on the LHS of an assignment statement, so you could have a writeable, alternate view of a variable. >Case statements are more general than in Ada. The when's don't need to >be static. So you can say something like: > > case True is > when Foo(...) => ...; > when Bar(...) => ...; > end case; > >where Foo and/or Bar might return True. If more than one alternative >matches, then the choice is arbitrary! This was probably inspired by Dijkstra's guarded command alternative-statement. Actually, his command made it into Green in another guise: as a task select statement. (Funny, I just read chap 10 of Gries' Science of Programming, the subject of which is...guarded commands!) >User-defined finalization. >User-defined assignment. Yeah, it's cool these finally got added to Ada. And another thing I want: real constructors. I'd like to be able to have indefinate limited types, that can be initialized in the declarative region: type Root_Stack is abstract tagged null record; type Root_Stack_Iterator is abstract tagged limited null record; constructor New_Iterator (Stack : access constant Root_Stack) return Root_Stack_Iterator'Class; which I can use to: procedure Copy (Left : in Root_Stack'Class; Right : in out Bounded_Stack) is Iterator : Root_Stack_Iterator'Class'New_Iterator (Left'Access); begin Look Ma, no heap allocation! -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271