🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #1527

Re: Oberon-2, WITH-Statement, problem (resolved)

#1527
From: Ulrich Neumerkel
Date: Thu, 08 Oct 1992 15:10
43 lines
1752 bytes
First of all, let me thank to Regis Crelier and Erwin Ewald Oertli
for resolving my misunderstanding.  Neither is it a bug, nor has it
to do with open arrays.  To put it into a nutshell, the procedure
P2 below is correct, while P1 is not.  This is the case although they
seem (at the first glance) to be equivalent.  Within the
WITH-statement in the procedure P1, P1 is declared as

	P1(t:TP,u:T)

and not as

	P1(t,u:T).

Thank You again,
	Ulrich




MODULE StatementWITHagain;
TYPE
	T = POINTER TO TX;
	TX = RECORD END;
	TP = POINTER TO TPX;
	TPX = RECORD(TX) END;

PROCEDURE ^P1(t,u:T);

PROCEDURE P2(t,u:T);
BEGIN
	WITH t: TP DO P1(u,NIL) END (*  this is correct *)
END P2;

PROCEDURE P1(t,u:T);
BEGIN
	WITH t: TP DO P1(u, (* error: incompatible assignment *) NIL ) END
END P1;
END StatementWITHagain.
-- 
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: <1992Oct8.151040.2354@email.tuwien.ac.at>
Path: arc1-ca.pugleaf.net!sparky!uunet!news.univie.ac.at!email!mips.complang.tuwien.ac.at!ulrich
References: <1992Oct6.195605.22657@email.tuwien.ac.at> <1992Oct6.212228.3016@gallant.apple.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.modula2
Path: arc1-ca.pugleaf.net!sparky!uunet!news.univie.ac.at!email!mips.complang.tuwien.ac.at!ulrich
From: ulrich@mips.complang.tuwien.ac.at (Ulrich Neumerkel)
Subject: Re: Oberon-2, WITH-Statement, problem (resolved)
Message-ID: <1992Oct8.151040.2354@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
References: <1992Oct6.195605.22657@email.tuwien.ac.at> <1992Oct6.212228.3016@gallant.apple.com>
Date: Thu, 8 Oct 1992 15:10:40 GMT
Lines: 43