comp.lang.ada
 help / color / mirror / Atom feed
* Forcing use of "constructors"
@ 2009-11-23 11:41 xorque
  2009-11-23 13:38 ` Ludovic Brenta
  0 siblings, 1 reply; 5+ messages in thread
From: xorque @ 2009-11-23 11:41 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-11-23 16:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-23 11:41 Forcing use of "constructors" xorque
2009-11-23 13:38 ` Ludovic Brenta
2009-11-23 14:15   ` xorque
2009-11-23 14:20   ` Maciej Sobczak
2009-11-23 16:18   ` Robert A Duff

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