Re: How to load/store procedure variables

From: [at]} <gruntz{>
Date: Sat, 13 Feb 1999 08:46:01 +0100

>
>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

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:42 UTC