[Oberon] Module finalization in PO2013

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Wed Dec 30 08:08:02 CET 2020


Hi Wojtek,

Just a small note of caution on Modules.SetClose(command): The solution
*wouldn’t* work if Modules.SetClose was used in module *Oberon* itself.

Reason: This has to do with the Oberon boot process: There, the call to Load(“Oberon”)
in the initialization sequence of module Modules actually never (!) terminates. So we always
have Modules.curmod = “Oberon” once the system is running. Only when a new module
M is loaded is Modules.curmod temporarily set to “M” (before being set back to “Oberon”)

Two cases where this is problematic:

1) Adding a command P to module Oberon, which *calls* Modules.SetClose(somecommand)

   -> when the user clicks on Oberon.P, this is NOT caught by Modules.SetClose

2) Adding a call Modules.SetClose(externalcommand) to the initialization *body* of Oberon

   -> this IS actually caught by Modules.SetClose, but there is no error message

This *could* be solved by a considerably more complex piece of code in Modules.SetClose.

But it was decided *not* to solve this one issue, because module Oberon is *known*
to have no module finalizers *and* it also wouldn’t make sense to add one (the module
is never unloaded).

-ap


    > 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



More information about the Oberon mailing list