🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #1487

Oberon-2, WITH-Statement, problem

#1487
From: Ulrich Neumerkel
Date: Tue, 06 Oct 1992 19:56
51 lines
1869 bytes
(*
	Hello, I have some problems in understanding the WITH-statement
	in Oberon-2 and would appreciate some help.

	As far as I understood the Oberon-2 report, the procedure Subel1
	below, should be equivalent to the procedure Subel2.
	However, in Subel2 an error is reported by the compiler.
	Even if a type guard is added (Subel3), the error remains.
	(The procedures are a stripped down version of some more
	useful code, indeed.)

	The platform was DECoberon Release 2.6
	(Oberon.2.6.tar.Z last modified Oct 3 21:09)
	

	Thanks in advance
	Ulrich
*)

MODULE StatementWITH;
TYPE
	T0 = POINTER TO T0X;
	T0X = RECORD END;

	T1 = POINTER TO T1X;
	T1X = RECORD(T0X) ARG: POINTER TO ARRAY OF T0 END;

PROCEDURE Subel1(t0: T0);
BEGIN
	Subel1(t0(T1).ARG[0])
END Subel1;

PROCEDURE Subel2(t0: T0);
BEGIN
	WITH t0: T1 DO
		Subel2(t0.ARG[0]) (* error 113 "incompatible assignment *)
	END
END Subel2;

PROCEDURE Subel3(t0: T0);
BEGIN
	WITH t0: T1 DO
		Subel3(t0(T1).ARG[0]) (* error 113 "incompatible assignment" *)
	END
END Subel3;
END StatementWITH.

-- 
Ulrich Neumerkel, ulrich@dec4.wu-wien.ac.at ulrich@mips.complang.tuwien.ac.at
TU-Wien, Vienna University of Technology, +431 58801 4477 fax +431 5057838
Institut fuer Computersprachen E185/1 Argentinierstr.8/4, A-1040 Wien Austria
Technical Details
Message-ID: <1992Oct6.195605.22657@email.tuwien.ac.at>
Path: arc1-ca.pugleaf.net!sparky!uunet!email!mips.complang.tuwien.ac.at!ulrich

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.modula2
Path: arc1-ca.pugleaf.net!sparky!uunet!email!mips.complang.tuwien.ac.at!ulrich
From: ulrich@mips.complang.tuwien.ac.at (Ulrich Neumerkel)
Subject: Oberon-2, WITH-Statement, problem 
Message-ID: <1992Oct6.195605.22657@email.tuwien.ac.at>
Keywords: WITH, Oberon-2, DECoberon
Sender: news@email.tuwien.ac.at
Nntp-Posting-Host: mips.complang.tuwien.ac.at
Reply-To: ulrich@mips.complang.tuwien.ac.at
Organization: Technische Universitaet Wien, Institut fuer Computersprachen
Date: Tue, 6 Oct 1992 19:56:05 GMT
Lines: 51