[Oberon] undefined record field when compiling in NO.

Chris Burrows chris at cfbsoftware.com
Sat Jan 4 02:14:01 CET 2014


> -----Original Message-----
> From: peasthope at shaw.ca [mailto:peasthope at shaw.ca]
> Sent: Friday, 3 January 2014 6:51 PM
> To: oberon at lists.inf.ethz.ch
> Subject: [Oberon] undefined record field when compiling in NO.
> 
> In the alpha release of NO, the compiler applied to
> 
> MODULE Test;
> IMPORT  ConfigInput;
> PROCEDURE Frame(F: ConfigInput.Frame);
> VAR x: INTEGER;
> BEGIN
> 	x := F.x
> END Frame;
> BEGIN END Test.
> 
> reports
>  compiling Test
> 		pos    105  err  83	undefined record field
> .
> This is in ConfigInput.
> TYPE
> 	Frame* = POINTER TO RECORD (Display.Frame)
> 		keys: SET;
> 		x, y: INTEGER;
> 		text: Texts.Text
> 	END;
> 
> So F.x in Test should be legitimate.
> Can anyone explain why the compiler complained?
> 
> Thanks,             ... Peter E.
> 

A feature of Oberon is that record types may be made partially visible.

Although the record type Frame is visible to client modules (i.e. it is
marked as with *) its elements are hidden. You can only access the
individual elements of an imported record which are also marked as exported
e.g. your statement would have worked if the declaration of Frame was:

 	Frame* = POINTER TO RECORD (Display.Frame)
 		keys: SET;
 		x*, y: INTEGER;
 		text: Texts.Text
 	END;

Regards,
Chris Burrows

CFB Software
http://www.astrobe.com






More information about the Oberon mailing list