[Oberon] Modula2 vs Oberon IMPORT

Jan Verhoeven jan at verhoeven272.nl
Sun Jan 9 03:00:09 CET 2011


On Saturday 08 January 2011 22:59:21 Jan Verhoeven wrote:
> On Saturday 08 January 2011 22:44:00 Duke Normandin wrote:
> > I was merely concerned about including every bloody procedure in
> > every module that happened to be referenced in the IMPORT
> > statement.
>
> Better learn to live with it though....

Do a test.

Make something like

MODULE test1;

IMPORT	Out;

VAR	chr	: CHAR;
	i	: INTEGER;
	text	: ARRAY 32 OF CHAR;

BEGIN
  text := "Hi there, Duke here.";
  (* Out.String (text); *)
  (* Out.Ln; *)
  i := 0;
  LOOP
    chr := text [i];
    IF  chr = 0X  THEN  EXIT  END;
    (* Out.Char (chr); *)
    INC (i)
  END;
  (* Out.Ln *)
END test1.

Make different versions each with one pair of comments taken out (5 
versions) and compile.

jan at Beryllium:~/Oberon/klim$ ls -l
total 5469
4099	tst1*	 312	test1.m
4131	test2*	 306	test2.m
4162	test3*	 300	test3.m
4194	test4*	 294	test4.m
4218	test5*	 288	test5.m

The executables grow a little bit but not much. 

jan at Beryllium:~/Oberon/klim$ ./test1
jan at Beryllium:~/Oberon/klim$ ./test2
Hi there, Duke here.jan at Beryllium:~/Oberon/klim$ ./test3
Hi there, Duke here.Hi there, Duke 
here.jan at Beryllium:~/Oberon/klim$ ./test4
Hi there, Duke here.
Hi there, Duke here.jan at Beryllium:~/Oberon/klim$ ./test5
Hi there, Duke here.
Hi there, Duke here.

For the fun, add 'In' to the import list, withoput calling it:

5884	test6*	 292	test6.m

It's clear. The full 'In' is included now. AFAIK this is universal.

-- 
Met vriendelijke groeten,

Jan Verhoeven
http://www.verhoeven272.nl



More information about the Oberon mailing list