[Oberon] Procedure variables and local procedures

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Thu Sep 28 18:11:11 CEST 2017


Note that even though the Oberon language report of Oberon-07 still states that “If a procedure P is assigned to a procedure variable of type T [...]. P must not be declared local to another procedure”, in the current implementation of Oberon-07, this restriction is not actually checked - at least not in the case when the procedure variable to which a local procedure is assigned is itself declared locally in the same scope, as in the following example:
  MODULE M;

    PROCEDURE P;
      VAR p: PROCEDURE;
      PROCEDURE Q; BEGIN END Q;
    BEGIN p := Q
    END P;
  END M.

which compiles correctly under Oberon 2013 without an error message.
AP
--------------------------------------------------------------------------
August Karlstrom fusionfile at gmail.com <mailto:fusionfile at gmail.com> Thu Sep 18 12:14:29 CEST 2017
In the latest revision of the Oberon language, access to identifiers in 
intermediate scopes is denied. Doesn't this imply that the restriction 
that only globally defined procedures can be assigned to procedure 
variables, is the unnecessary?

-- August

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20170928/5ea5b981/attachment.html>


More information about the Oberon mailing list