[Oberon] Oberon usage

Aubrey.McIntosh at Alumni.UTexas.Net Aubrey.McIntosh at Alumni.UTexas.Net
Sun Jul 11 17:28:49 MEST 2010


On Sun, Jul 11, 2010 at 9:43 AM, spir <denis.spir at gmail.com> wrote:
> * Oberon-2 is unusable! *
> - no literal notation for arrays and records/objects (center := Point{x:=0,y:=0};)

I don't understand how this notion is unsatisfactory for you:
center := ThisP ( 5.0, 7.5 )

........
MODULE Denis2;
	IMPORT Math;
TYPE	
	Point* = RECORD END;
	PointPtr* = POINTER TO Point;
	
	PointPolar* = RECORD (Point) mag : REAL; angle : REAL END;
	PointPolarPtr* = POINTER TO PointPolar;
VAR
	center* : PointPtr;
	
PROCEDURE ThisP(x, y : REAL ) : PointPtr;
	VAR
		aux : PointPolarPtr;
BEGIN
	aux.mag := Math.sqrt(x*x + y*y);
	aux.angle := Math.arctan( y / x );
	RETURN aux
END ThisP;

BEGIN
	center := ThisP ( 5.0, 7.5 )
END Denis2.

-- 
-- 
Aubrey McIntosh, Ph.D.
1502 Devon Circle
Austin TX 78723-1814
http://home.grandecom.net/~amcintosh/aubrey/Search/


More information about the Oberon mailing list