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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!p32g2000vbi.googlegroups.com!not-for-mail From: xorque Newsgroups: comp.lang.ada Subject: Forcing use of "constructors" Date: Mon, 23 Nov 2009 03:41:55 -0800 (PST) Organization: http://groups.google.com Message-ID: <15055d2d-0dd5-4c84-bd4a-1cc60e9dea2d@p32g2000vbi.googlegroups.com> NNTP-Posting-Host: 78.143.202.207 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1258976515 13184 127.0.0.1 (23 Nov 2009 11:41:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 23 Nov 2009 11:41:55 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p32g2000vbi.googlegroups.com; posting-host=78.143.202.207; posting-account=D9GNUgoAAAAmg7CCIh9FhKHNAJmHypsp User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.0.13) Gecko/2009081019 Firefox/3.0.13,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8209 Date: 2009-11-23T03:41:55-08:00 List-Id: Hello, all. What's the preferred way to mandate that objects be created by the use of given "constructor" subprograms? By this, I mean that I want to create a type and the only way to get new values of this type is to use a subprogram that I provide. * It's a record type. * A few of the components must be set to "sensible" values before use. * What constitutes a "sensible" value isn't known until runtime. * I don't particularly want to add "is initialized" checks on all subprograms in the package. Regards, xw