Is this possible in Python ?

Helmut Jarausch jarausch at igpm.rwth-aachen.de
Thu May 15 04:03:55 EDT 2003


Hi

being new to Python I would be interested if
the following feature already present in an
ancient programming language called Simscript
can be simulated in Python.

Given a program with assignments like
a=b+a
one can say either
monitor 'a' on the left
or
monitor 'a' on the right.

In that case one has to provide two functions
say a_left and a_right.
Whenever 'a' is assigned something a_left
ist called with the current value of 'a' and
the new value to be assigned to 'a' and it decides
if and what will be assigned to 'a'.
On the other hand, a_right is called whenever
'a' is `read' with the current value of 'a' as
parameter. One can then check if this value
is valid.

I have missed that feature in many programming
languages.

Thanks for your comments,

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany





More information about the Python-list mailing list