How to load/store procedure variables

Wojtek Skulski (skulski@xia.com)
Fri, 12 Feb 1999 19:15:54 -0800

Hi:

thank Stewart Greenhill <greenhil@murdoch.edu.au>
for explanations concerning view printing.

Now I have a question that Oberon Microsystems will hate:
how do I store/load procedure variables? I looked at Stores
definition and there no Writer/Reader methods there concerning
pointer storing/loading nor procedure variables.

I have read a somewhat obsure statement in BB dosc that
procedure variables are a bad thing, and that one has to use
"composition" instead, but I am not there yet to know what
composition is. Therefore, I have defined one of my types as

Mapper* = PROCEDURE (a: Axis; xreal: REAL): INTEGER;
InvMapper* = PROCEDURE (a: Axis; xint: INTEGER) : REAL;

Axis* = POINTER TO RECORD
x0, x1, delta: REAL;
i0, i1: INTEGER;
map*: Mapper; (** world --> view, installable *)
inv*: InvMapper (** view --> world, installable *)
END;

I believe this to be a very flexible solution inspired by
System-3 framework where all handlers are installable.

Now I am scratching my head how to make the Axis persistent.
Shouls I introduce a case variable "axisKind: INTEGER",
store the value of that variable, and upon loading make a
CASE statement which would install a proper mapper?
Such a solution will work, but is hardly extensible.

Any suggestions what is the recommended way of dealing with
installable behavior?

Thank you in advance,

Wojtek