Re^n: [Oberon] identity of two VARs

shark at gulfnet.sd64.bc.ca shark at gulfnet.sd64.bc.ca
Wed Sep 14 22:33:51 CEST 2005


Lior wrote,
l> I think this should be better:
IF SYSTEM.ADR(source[0]) = SYSTEM.ADR(target[0]) THEN...

What is the advantage?

Dan wrote,
d> Is the same for Oberon if you use x, y: POINTER TO ARRAY OF CHAR.
x = y is different of x^ = y^, isn't it?

What if the client wants to submit ARRAY OF CHAR
parameters and I can not rewrite the client?  Does 
the parameter passing automatically convert the 
ARRAY OF CHAR to POINTER TO ARRAY OF CHAR?  Will 
this work?

MODULE Test;
VAR
	str1, str2, str3: ARRAY 8 CHAR;
   ...
PROCEDURE Identical*(VAR source, target: POINTER TO ARRAY OF CHAR):integer;
   (* Similar to the earlier definition. Pointers 
    dereferenced as needed. *)
END Identical;
   ...
   
BEGIN
	str1:= "apple"; str2:= "orange"; str3:= "orange";
	CASE Identical(str1, str1) OF ... END;
	CASE Identical(str1, str2) OF ... END;
	CASE Identical(str2, str3) OF ... END;
END Test.

Jan wrote,
j> This looks like C++, not like a Wirthian language. 
 With a contest to match.

Certainly. 

I probably need to tell you the dish, but let me warm 
these ingredients first.

Thanks,         ... Peter

Desktops.OpenDoc  http://carnot.pathology.ubc.ca/




More information about the Oberon mailing list