comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <mheaney@on2.com>
Subject: Re: An improved Ada?
Date: Mon, 27 Sep 2004 16:40:40 -0400
Date: 2004-09-27T20:29:52+00:00	[thread overview]
Message-ID: <41587840$0$74186$39cecf19@news.twtelecom.net> (raw)
In-Reply-To: 311c6b78.0409271138.1795d07c@posting.google.com


"jn" <jonas.nygren@telia.com> wrote in message
news:311c6b78.0409271138.1795d07c@posting.google.com...
>
> after spending numerous hours to do a simple double linked list
> package - yes, I have seen charles - a 5 hours tedious car drive came
> up with the following example of an improved Ada language:
>   - prefix notation (as for tasks and protected types)
>   - Ada OO syntax in line with tasks and protected objects
>   - reference types
>   - controlled, allocates from Storage_Pools.Garbage_Collected :)
>   - implicit up- and down-conversions

Distinguished-receiver syntax is being added to the language, for tagged
types.

  L : List;
begin
  L.Append (42);

This is largely the reason why we made the AI-302 container types publicly
tagged.

Tagged types and limited types are already pass-by-reference, so usually you
don't need explicit reference types (a la C++), since the pass-by-reference
happens automatically.

The fact that the type is publicly tagged means that you're allowed to alias
parameters:

procedure Op (L : in out List) is
begin
   ... L'Access ...; --ok
end;

For class-wide types, the up-conversion happens automatically, since the
ancester class-wide type "covers" its descendent, e.g.

type T is tagged null record;
type NT is new T with null record;

procedure Op (O : T'Class);

declare
   O : NT;
begin
   Op (O);  --ok
end;

All the AI-302 containers (including the list) are controlled, so memory
management ("garbage collection") is automatic.

Not sure what your issue is, I guess...





  reply	other threads:[~2004-09-27 20:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-27 19:38 An improved Ada? jn
2004-09-27 20:40 ` Matthew Heaney [this message]
2004-09-28 20:41   ` Wojtek Narczynski
2004-09-28 22:54     ` Randy Brukardt
2004-09-28  5:45 ` Matthew Heaney
2004-09-29 17:05 ` jn
2004-09-29 18:26   ` Matthew Heaney
2004-09-29 21:33   ` Randy Brukardt
2004-09-29 22:15     ` tmoran
2004-09-30 16:55       ` tmoran
replies disabled

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