[Oberon] Protocols (interfaces) in Oberon-2
joerg.straube at iaeth.ch
Sun Oct 25 15:46:04 CET 2020
Isn‘t output one of the examples that could benefit of „interfaces“?
- output for debugging
- output to file
- output to screen
- output to serial line
- output in a pipe..
All those module could offer Int(), String(), Char(), Real() etc.
In other words, whenever you can write
IMPORT A := B;
A and B should implement the same interface.
> Am 25.10.2020 um 14:46 schrieb Andreas Pirklbauer <andreas_pirklbauer at yahoo.com>:
> > Do you support something like the following?
> > TextDesc = RECORD (TextProtocol.TextDesc, WriteProtocol.WriterDesc) END ;
> Yes! But multiple inheritance has it own set of issues, as you’re surely aware.
> It adds a host of new complexities which are well documented in the literature.
> Witness the Go or the Java implementations that you mentioned.
> But leaving multiple inheritance aside, I wonder whether can make a point
> for adopting protocols. So far, I haven’t found any. It seems like one of those
> features that shouldn’t be there in the first place. Or I am wrong?
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Oberon