[clean-list] Help on implementation of interactive local state transition syst ems in Clean...

Fabien Todescato f.todescato@larisys.fr
Tue, 12 Jun 2001 18:25:32 +0200


Dear Cleaners,

And ObjectIO practitioners, in the quest for ways to neatly modularize
interactive applications in a set of loosely coupled stateful components, I
have dived into Dr. Peter Achten and Pr. Rinus Plasmeijer article 'The
implementation of interactive local state transition systems in Clean'.

I went my way through the section about global state transition systems, and
the section introducing the type definitions for local state transition
systems, but I am still stuck on the crucial use of lazy evaluation in the
function nextstate - section 2.2 local state transition systems -.

It is explained indeed that "...The crucial point is that while nextstate is
collecting the local state components, it immediately adds (lazy) reference
to the result local state values in the recursive data structure." , and
later on "...It should be noted that, as promised, the state transition
argument of nextobjstate contains a reference to the result of nextobjstate
itself, namely obj1".

I have the vague intuition that this technique is required to have a correct
behavior of the state transition system in case a local state transition
function of some object causes - directly or indirectly - the application of
other state transition functions to the same object. Indeed, I experienced
putting a strict #! instead of the lazy # in the call back function of some
interactive object causing indirectly state transitions on the same object,
and got a splendid "Cycle in spine" error when the call back was
evaluated...

This is, however, not clear at all to me, I have troubles visualizing
correctly the mechanism, and I would be grateful to anyone providing me with
further explanations.

Speaking from my humble experience, one of the main problem with the
acceptance of pure functional programming in the mainstream, is that the
problem of the complexity of the state of medium-sized to large stateful
applications is difficult to handle, a problem, however, that Object
Oriented programming does address adequately. It seems that the design of
the ObjectIO library provides an elegant solution to that problem in a true
functional spirit, but unfortunately it is difficult to find documentation
about that technique targeted to the average software engineer... I may
suggest that an addendum to the otherwise excellent ObjectIO documentation
may be welcome, that would emphasize the use of local state transition
systems for structuring complex state in a set of loosely coupled stateful
components, and not only from the GUI construction point of view, but from a
general software engineering point of view.

I am looking forward to your answers, and help :)

Sincerely yours, Fabien TODESCATO