[Oberon] [EXT] Module finalization in PO2013

Skulski, Wojciech skulski at pas.rochester.edu
Wed Dec 30 00:56:49 CET 2020


Andreas:

  wonderful! Thank you very much!

Wojtek
________________________________________
From: Oberon [oberon-bounces at lists.inf.ethz.ch] on behalf of Andreas Pirklbauer [andreas_pirklbauer at yahoo.com]
Sent: Tuesday, December 29, 2020 6:44 PM
To: Oberon List
Subject: [EXT] [Oberon] Module finalization in PO2013

A simple module finalization mechanism that does NOT require a change in the
Oberon-07 language (i.e. no CLOSE as as Component Pascal) is available at

  https://github.com/andreaspirklbauer/Oberon-module-finalization

Comments are welcome. Test program:

  MODULE Test;
    IMPORT Modules, Texts, Oberon;

    VAR W: Texts.Writer;

    PROCEDURE Finalize;
    BEGIN Texts.WriteString(W, "Finalization of Test");
      Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf)
    END Finalize;

    PROCEDURE Start*;
    BEGIN (*load module*)
    END Start;

  BEGIN Texts.OpenWriter(W); Modules.SetClose(Finalize)
  END Test.

  ORP.Compile Test.Mod/s ~      # compile Test
  Test.Start ~                  # load Test
  System.Free Test ~            # unload Test (prints "Finalization of Test")


More information about the Oberon mailing list