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-Thread: 103376,2e2db8edf2656165 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Sat, 24 Sep 2005 00:30:23 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: Subject: Re: Constructing an object Date: Sat, 24 Sep 2005 00:34:08 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4952.2800 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4952.2800 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-0mThsSLfnjrSnjLs0liH8AePEK9PGBwGxJMT6VPa9zrIs1ojaBrVI4Q/4GFsQHHEKd/no6sQM74OMs0!44zGH1o3SoiZ8meHdaRUWhszFR/MFr/LxKxlsr5ZCE+YCC9ZbZgtiqfjJZFgIxWeav7/Et874awI X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:5085 Date: 2005-09-24T00:34:08-05:00 List-Id: "Matthew Heaney" 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.