>
>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;
>
>Any suggestions what is the recommended way of dealing with
>installable behavior?
use objects instead of procedure variables:
Mapper* = POINTER TO RECORD (Stores.Store)
(m: Mapper) ConvertToView(a: Axis; x: REAL): INTEGER;
(m: Mapper) ConvertToWorld(a: Axis; x: INGEGER): REAL;
END;
Axis* = POINTER TO RECORD
x0, x1, delta: REAL;
i0, i1: INTEGER;
mapper*: Mapper; (** installable **)
END;
now you ca externalize the Mapper using Stores.Writer.WriteStore.
- Dominik Gruntz, Oberon microsystems AG, Switzerland
Received on Sat Feb 13 1999 - 08:51:10 UTC