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!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!elnk-atl-nf1!newsfeed.earthlink.net!stamper.news.atl.earthlink.net!newsread3.news.atl.earthlink.net.POSTED!d9c68f36!not-for-mail From: Marin David Condic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Idiom for a class and an object in Ada References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Wed, 20 Oct 2004 12:42:23 GMT NNTP-Posting-Host: 209.165.23.78 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.atl.earthlink.net 1098276143 209.165.23.78 (Wed, 20 Oct 2004 05:42:23 PDT) NNTP-Posting-Date: Wed, 20 Oct 2004 05:42:23 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:5513 Date: 2004-10-20T12:42:23+00:00 List-Id: In my particular example, I have outlawed the use of access types. It doesn't matter why. You can get a perfectly good static allocation of exactly what is needed with the plain vanilla object declaration ala: Some_Object : Class_Package.Tagged_Record_Type ; I don't find a problem with that. It is simple and enables me to get exactly what I need from the compiler, linker and other tools down the chain. The question is "Where do you put it?" Dimitri seems to like a child package under the "class" package. I've used that in the past. It works fine, but does proliferate packages. There might be some variations on that (one "object" per child package versus all "objects" in one child package?) There are other spots to declare such entities and I'm wondering what is preferred by most Ada people who actually declare some static (library level) 'objects'? MDC Matthew Heaney wrote: > > The intended Ada95 mechanism for controlling instance creation is to > declare the type as limited and indefinite, and for the package to > provide a factory function to create instances of the type. -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jsf.mil/NSFrames.htm Send Replies To: m o d c @ a m o g c n i c . r "Power corrupts. Absolute power is kind of neat" -- John Lehman, Secretary of the Navy 1981-1987 ======================================================================