From: reinkor <reinkor@gmail.com>
Subject: Question on type invariants
Date: Wed, 25 Jan 2017 00:38:52 -0800 (PST)
Date: 2017-01-25T00:38:52-08:00 [thread overview]
Message-ID: <65f79e53-a468-4b77-8ee1-440c26a09371@googlegroups.com> (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
next reply other threads:[~2017-01-25 8:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-25 8:38 reinkor [this message]
2017-01-25 22:06 ` Question on type invariants 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox