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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5117b1b6391a0e06 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news1.google.com!news.glorb.com!newshosting.com!nx01.iad01.newshosting.com!newsfeed-east.nntpserver.com!nntpserver.com!newsfeed1.sea.pnap.net!newsfeed.pnap.net!brmea-news-1.sun.com!news1nwk.sfbay.sun.com!new-usenet.uk.sun.com!not-for-mail From: Ole-Hjalmar Kristensen Newsgroups: comp.lang.ada Subject: Re: A simple ADA puzzle (I haven't the answer) Date: 18 Jun 2004 11:14:44 +0200 Organization: Sun Microsystems Message-ID: References: <1087410710.477506@master.nyc.kbcfp.com> <1087474761.60413@master.nyc.kbcfp.com> <7o83d0hf6sqgng2980e1tg7iu864m5m50u@4ax.com> NNTP-Posting-Host: europa1.norway.sun.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: new-usenet.uk.sun.com 1087550085 11217 129.159.113.161 (18 Jun 2004 09:14:45 GMT) X-Complaints-To: usenet@new-usenet.uk.sun.com NNTP-Posting-Date: 18 Jun 2004 09:14:45 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: g2news1.google.com comp.lang.ada:1649 Date: 2004-06-18T09:14:45+00:00 List-Id: What do you mean it does not work in C++? It works just fine, and you may even do: class Base{...}; Base* foo () { class Local : public Base {...}; return new Local(); }; Dmitry A. Kazakov writes: > >Knowing what a type is does not tell you that in > >Ada a polymorphic type can't be declared in the same places that > >other types can. > > Not worse than in C++, where you cannot: > > void foo () > { > class Local {...}; > Local Thing; > > ... > }; > -- C++: The power, elegance and simplicity of a hand grenade.