[Oberon] Protocols (interfaces) in Oberon-2

Joerg joerg.straube at iaeth.ch
Sun Oct 25 15:46:04 CET 2020


Andreas

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.

br
Jörg

> 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
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20201025/6badbcdf/attachment.html>


More information about the Oberon mailing list