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!nntp.giganews.com!peer01.cox.net!cox.net!newsfeeds.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada References: Subject: Re: Idiom for a class and an object in Ada Date: Tue, 19 Oct 2004 10:44:04 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response Message-ID: <41752559$0$91011$39cecf19@news.twtelecom.net> Organization: Time-Warner Telecom NNTP-Posting-Date: 19 Oct 2004 14:31:53 GMT NNTP-Posting-Host: 978adb4f.news.twtelecom.net X-Trace: DXC=E;jIRUAKb8kQj6MhHXa^^g6TZDDFB78Rk0MABdYZAA8S: "Marin David Condic" wrote in message news:s78dd.2345$ta5.833@newsread3.news.atl.earthlink.net... > > Maybe my question isn't really clear. I'm thinking of something of the > flavor: > > package AD_Converter_Class is > > type AD_Converter is tagged private ; > > procedure Some_Op_Like_Read_The_AD_Converter ( > Converter : in out AD_Converter) ; > > end AD_Converter_Class ; > > Don't get hung up on it being an AD converter. The question relates more > to the proper idiom for a class that might have one or a few static > objects (as opposed to anything I might dynamically create and destroy > through the life of a program) Where would the best place be to declare > the objects of that class assuming that the storage must be static? First of all, if we're going to have a conversation, we need to agree on terms. The term "class" in Ada has a very specific meaning. In Ada, it means "family of types." Specifically, it means "family of tagged types, having this common ancestor." You said above "proper idiom for a class," but it's not clear whether you just mean "type," or whether you mean "class" (as in "family of types"). If you just mean "type," then say so. It certainly doesn't help anyone that you named the package AD_Converter_Class. In fact it's horribly confusing. Please use Ada terms, or I won't understand you. Don't say "class" if you mean "type." Secondly, you haven't explained why your AD_Converter type is tagged, or why it's non-limited. (What does assignment of AD_Converter objects even mean???) Please give me a reason why this type is tagged, and if it's tagged then please tell me about its descendents. > What is the preferred Ada idiom for something like this? I showed you the proper idiom. What's the problem?