comp.lang.ada
 help / color / mirror / Atom feed
From: xorque <xorquewasp@googlemail.com>
Subject: Forcing use of "constructors"
Date: Mon, 23 Nov 2009 03:41:55 -0800 (PST)
Date: 2009-11-23T03:41:55-08:00	[thread overview]
Message-ID: <15055d2d-0dd5-4c84-bd4a-1cc60e9dea2d@p32g2000vbi.googlegroups.com> (raw)

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



             reply	other threads:[~2009-11-23 11:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23 11:41 xorque [this message]
2009-11-23 13:38 ` Forcing use of "constructors" Ludovic Brenta
2009-11-23 14:15   ` xorque
2009-11-23 14:20   ` Maciej Sobczak
2009-11-23 16:18   ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox