[Oberon] Protocols (interfaces) in Oberon-2

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Mon Oct 26 11:33:44 CET 2020


    > Here my proposal for doing this in standard Oberon-07. In the previous mail,
    > I separated interface/protocol and implementation for clarity. The same should
    > be done here. For brevity, I combined the two here.
    > 
    > [...]

Hi Jörg,

Your examples seem to show that this can indeed be done with modules (and/or
module aliases) alone. What you call “definition” in your various examples
essentially corresponds to what used to be the definition module in Modula-2.

In the absence of multiple inheritance, I’d say that therefore there is no need to
also add protocols as yet another language construct (I had been intrigued by
the simplicity of my proof-of-concept implementation.. but I was misguided).

It’s a bit like information hiding (which is the business of modules, not
records). The module is a powerful construct indeed.

-ap




More information about the Oberon mailing list