[Oberon] Question about Oberon semantics of VAR parameters

rochus.keller at bluewin.ch rochus.keller at bluewin.ch
Sat Dec 7 00:32:45 CET 2019


Can someone please explain to me why the following code in the module display of the Oberon system does not cause a compiler error.

On line 38 there is the statement "v.handle(v, M)" with "handle" being of procedure type "PROCEDURE (F: Frame; VAR M: FrameMsg);" with "FrameMsg = RECORD END;" and the actual parameter M has the following type:
ViewerMsg* = RECORD (Display.FrameMsg)
        id*: INTEGER;
        X*, Y*, W*, H*: INTEGER;
        state*: INTEGER
      END;

Since FrameMsg and ViewerMsg are not related and the formal and actual parameter M are not the same according to the Oberon-07 language report and "Programming in Oberon" (2004 edition) I would expect an error, but the compiler accepts it. This is just one of many similar examples. Do I completely misinterpret both documents or is the implemented one actually different from the specified language?

Best
R.


More information about the Oberon mailing list