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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Parameterless generic instance in place of opaque type instance Date: Sun, 28 Jul 2013 09:30:18 +0200 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 28 Jul 2013 07:23:53 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="2b3884a634d8f846e0712b4e3a92507a"; logging-data="29294"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SSne9ALo/LkoPwlIV9ScC" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 In-Reply-To: Cancel-Lock: sha1:eT8TQ7LnxUpE6jTaIu6161FWueE= X-Enigmail-Version: 1.5.2 Xref: news.eternal-september.org comp.lang.ada:16573 Date: 2013-07-28T09:30:18+02:00 List-Id: Le 28/07/2013 07:49, Yannick DuchĂȘne (Hibou57) a Ă©crit : > For these types, a parameterless generic instance may be enough. I hope > most compilers are clever enough to not duplicate machine code for each > of these instances, and just duplicate their data (valid or invalid > assumption?). This is a basic design pattern of HOOD (and the main one in early versions). Since HOOD is based on abstract state machines, it represented each machine with a package, and the package was made generic if you wanted several identical ASM. In early versions of HOOD, such generics were called "classes", since they defined a model for several instances. Due to the confusion with OOP classes, the name was changed to "generic" later. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr