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,147f221051e5a63d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!storethat.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsfeed01.chello.at!newsfeed02.chello.at!news.hispeed.ch.POSTED!not-for-mail Message-ID: <9547605.YeDe1LAlLJ@linux1.krischik.com> From: Martin Krischik Subject: Re: memory management in Ada: tedious without GC? Newsgroups: comp.lang.ada Date: Sat, 17 May 2008 19:23:40 +0200 References: <4ddef8bf-b5b1-4d7e-b75b-386cd6c8402c@l17g2000pri.googlegroups.com> <482E8A9D.5040401@obry.net> <8ACXj.3769$IK5.622@trnddc04> User-Agent: KNode/0.10.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@hispeed.ch Organization: hispeed.ch NNTP-Posting-Host: 84.75.166.64 (84.75.166.64) NNTP-Posting-Date: Sat, 17 May 2008 19:45:02 +0200 X-Trace: 8daa5482f199ef1ee03e505958 Xref: g2news1.google.com comp.lang.ada:169 Date: 2008-05-17T19:23:40+02:00 List-Id: Bob Klungle wrote: > Actually, the same construct exists in c/c++. > Stack frame allocation only needs a block to allow object definitions (c++ > does it almost anywhere). > To whit: > > #include > > int main(void) > > { > int x = 3; > int y = 7; To make is more complicated make that: int y = f (x); > int z = 2; > printf("x, y, z: %0d, %0d, %0d\n", x, y, z); > { > int w = 9; And here in Ada you can have: int v [y]; Note that C99 supports this construct as well, however there is only one compiler that implements this particular feature. And yes I know about vector<> - in fact Ada has a generic Vector class as well. > printf("x, y, z, w: %0d, %0d, %0d, %0d\n", x, y, z, w); > > } > > } Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com