[Oberon] Clarifying type compatibility in Oberon-07

Jörg joerg.straube at iaeth.ch
Sun Oct 8 08:20:27 CEST 2017


Chris

A question and I’m really curious to get your opinion
Would you allow this as well?

MODULE X
VAR a*: RECORD real, img: REAL END;

MODULE Y;
IMPORT X;
VAR b: RECORD x, y: REAL END;
b := X.a

If no, why ARRAYs but not RECORDs?
if yes, why do we need typing then?

Jörg


> Am 08.10.2017 um 07:52 schrieb Jörg <joerg.straube at iaeth.ch>:
> 
> Chris
> 
>>> I have used the interpretation that I believe is most useful when programming microcontrollers with Oberon. 
> 
> Don't get me wrong. I fully understand your argument. During my career, I wrote quite some low-level code in Oberon myself and know that its typing can really be a kick in the…  Quite some SYSTEM stuff has to be used; this is the reason why I write IMPORT S := SYSTEM :-P
> 
> And if you already have a variable you are tempted to re-use it for several different stuff (with different types). But nevertheless: Oberon is not mainly written having us in mind, Oberon should be a general, type-bound and hence safe language as the compiler detects a lot of accidental typos on its own.
> I’m open to relax the type system. But the examples, I heard so far do not convince me enough. If you have to write ARRAY 10 OF INTEGER over and over again, you’ll be better off declaring all types you need for your drivers in a separate MODULE where you export your type collection.
> 
> br
> Jörg
> 
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon



More information about the Oberon mailing list