[Oberon] Clarifying type compatibility in Oberon-07

August Karlstrom fusionfile at gmail.com
Wed Oct 11 15:41:41 CEST 2017


On 2017-10-11 14:30, Jörg wrote:
>   * CONCEPTUALLY different from the following code (“code B”)
> 
> Oberon differentiates between the concept of structured types (“A”) vs 
> basic (“B”) types.
One argument in favor of structural equivalence is that Oberon already 
uses non-strict name equivalence. Module M is valid:

	MODULE M;
	
		TYPE
			Apple = INTEGER;
			Orange = INTEGER;
			
		VAR
			x: Apple;
			y: Orange;
			
	BEGIN
		y := x
	END M.

Then we might as well allow module M1:

	MODULE M1;
	
		TYPE
			Apple = ARRAY 10 OF INTEGER;
			Orange = ARRAY 10 OF INTEGER;
			
		VAR
			x: Apple;
			y: Orange;
			
	BEGIN
		y := x
	END M1.

I don't see how M1 is worse than M. Also I don't understand the 
disadvantage of strict name equivalence where each type declaration 
introduces a distinct type. Can someone enlighten me?


-- August


More information about the Oberon mailing list