comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Constructing an object
Date: Sat, 24 Sep 2005 00:34:08 -0500
Date: 2005-09-24T00:34:08-05:00	[thread overview]
Message-ID: <NcGdnUG8SfLyeaneRVn-oA@megapath.net> (raw)
In-Reply-To: ud5n0t1jv.fsf@earthlink.net

"Matthew Heaney" <matthewjheaney@earthlink.net> wrote in message
news:ud5n0t1jv.fsf@earthlink.net...
> The big improvement in Ada 2005 is that there's new syntax for
> initializing a return value (I showed it in one of my examles), that you
> can use even for limited types.  (Only for limited types?  Hopefully an
> ARG member will jump in here and, er, elaborate.)

You were right the first time; any function can use the extended return
statement. Only limited types have a guarantee of building the result in
place, but compilers can do that for any object when they can arrange it.

The *other* big improvement in Ada 200Y is the
generic_dispatching_constructor I mentioned earlier, since it lets you
create objects of a *type* determined at runtime (not just a *subtype*). Ada
95 has that in the predefined T'Class'Input streaming function, but there
was no way for the user to write their own. That allows you to avoid giant
case statements that include every type in the program; instead you can use
a registration scheme so that adding a type to the program is as easy as
withing the package for the new type.

                               Randy.






      reply	other threads:[~2005-09-24  5:34 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-21  8:46 Constructing an object Maciej Sobczak
2005-09-21 10:16 ` Georg Bauhaus
2005-09-22  7:21   ` Maciej Sobczak
2005-09-21 11:55 ` Dmitry A. Kazakov
2005-09-22  7:28   ` Maciej Sobczak
2005-09-22  7:45     ` Maciej Sobczak
2005-09-22 13:33       ` Dmitry A. Kazakov
2005-09-24  5:23         ` Randy Brukardt
2005-09-24  9:47           ` Dmitry A. Kazakov
2005-09-29  0:12             ` Randy Brukardt
2005-09-29  8:17               ` Dmitry A. Kazakov
2005-09-29 22:21                 ` Randy Brukardt
2005-09-30  8:14                   ` Jean-Pierre Rosen
2005-09-30 19:28                     ` Dmitry A. Kazakov
2005-09-30 17:49                   ` Robert A Duff
2005-10-01  0:44                     ` Randy Brukardt
2005-10-01 10:49                       ` Dmitry A. Kazakov
2005-10-01 11:06                       ` Tapio Kelloniemi
2005-10-01 14:13                         ` Robert A Duff
2005-10-02 11:52                           ` Tapio Kelloniemi
2005-10-01 15:19                       ` Georg Bauhaus
2005-09-23  5:40 ` Matthew Heaney
2005-09-23  7:18   ` tmoran
2005-09-23  8:23   ` Maciej Sobczak
2005-09-23 12:04     ` Dmitry A. Kazakov
2005-09-23 12:36       ` Matthew Heaney
2005-09-23 13:03         ` Hyman Rosen
2005-09-23 13:41           ` Maciej Sobczak
2005-09-23 14:23           ` Matthew Heaney
2006-01-17  6:28             ` [Offtopic] " James Dennett
2005-09-23 13:42         ` Dmitry A. Kazakov
2005-09-23 14:27           ` Matthew Heaney
2005-09-23 12:24     ` Matthew Heaney
2005-09-24  5:34       ` Randy Brukardt [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