comp.lang.ada
 help / color / mirror / Atom feed
* Question on type invariants
@ 2017-01-25  8:38 reinkor
  2017-01-25 22:06 ` Randy Brukardt
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: reinkor @ 2017-01-25  8:38 UTC (permalink / raw)


This question may be a bit imprecise:

Assume a complex object A (for example a set of records stored in a Container or file). Let S (for example an array of records) represent a summary of A (derived 
from A).

I want to update S (call "Update_S") in an economical way. S may not be updated immediately each time A changes. And I would prefer not to update too much when S is up-to-date anyway (i.e. avoid redundant updating). I also want to keep things simple and avoid to combine updating S in any smart way when I change A (I may not have full control over the modifications of A anyway). The main thing is that S in "fresh"/updated when I use it (not necessary when A changes).

In principle I could mark A and S with a "last-modified-time-flag" so I can update S when I find it necessary. This has similarities to unix "make". Bad idea?

I can program the whole thing and keep the concepts in my head, but is it a natural "Ada way" to secure that S is up-to-date when used? Is "type invariants" of any help?

reinert

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

end of thread, other threads:[~2017-01-31  6:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-25  8:38 Question on type invariants reinkor
2017-01-25 22:06 ` Randy Brukardt
2017-01-26  4:31   ` reinkor
2017-01-26  4:32   ` reinkor
2017-01-26  8:38 ` Dmitry A. Kazakov
2017-01-27  9:20   ` reinkor
2017-01-27  9:47     ` Dmitry A. Kazakov
2017-01-31  6:44       ` reinkor
2017-01-26 16:18 ` Robert Eachus
2017-01-27  5:35   ` reinkor
2017-01-27  5:47   ` reinkor

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