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,901038687c38f61c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!14bb18d8!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: Idiom for a class and an object in Ada References: <1dljnq136n1j1.2oxluar9ofho.dlg@40tude.net> From: Matthew Heaney Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 21 Oct 2004 12:45:09 GMT NNTP-Posting-Host: 64.185.133.124 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.atl.earthlink.net 1098362709 64.185.133.124 (Thu, 21 Oct 2004 05:45:09 PDT) NNTP-Posting-Date: Thu, 21 Oct 2004 05:45:09 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:5578 Date: 2004-10-21T12:45:09+00:00 List-Id: "Dmitry A. Kazakov" writes: > On Thu, 21 Oct 2004 01:46:39 GMT, Matthew Heaney wrote: > > > I don't understand this comment. How else do you dynamically create > > instances of T? > > Why should they be created dynamically (heap)? Heap vs. stack is a > matter of object's scope. It should have little or no impact on the > design of the type. If it has then probably because of language > deficiency, as in C++, or, yes, in Ada where there was no way to > initialize limited objects. That will be corrected soon, I hope. My point was that there is *no* difference between Ada95 and C++ here. My reasons for writing the code as I did (that is, writing a factory function that returns a pointer) had nothing to do with language. > For Marin's case the objects are not dynamic. So if read-only objects > would suffice, one can just use functions returning limited objects: Finally, someone else sees the light...