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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!c37g2000yqi.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Enforcing initialization protocol for protected type Date: Mon, 7 Sep 2009 08:15:43 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1fcccc80-0142-4f07-8852-8d151ea96ee2@c37g2000yqi.googlegroups.com> NNTP-Posting-Host: 137.138.182.236 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1252336543 10009 127.0.0.1 (7 Sep 2009 15:15:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 7 Sep 2009 15:15:43 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c37g2000yqi.googlegroups.com; posting-host=137.138.182.236; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8211 Date: 2009-09-07T08:15:43-07:00 List-Id: Consider the Needs_Constructor type from the code example in the Ada wikibook: http://en.wikibooks.org/wiki/Ada_Programming/Types/limited#Initialisi... Is it possible to ensure a given initialization protocol for protected types as well? The problem is that protected types cannot have unknown discriminants. How can I ensure that objects of a given protected type are always initialized with a call to proper constructor function? Note that wrapping a protected object in another one (presumably limited and private) would limit the possibility to perform timed entry calls on the target protected object and preserving this possibility is essential in my actual use case. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada