Article View: comp.lang.oberon
Article #1301Re: The Trouble with WITH...
From: Alex Nedorya
Date: Mon, 08 Apr 1996 19:20
Date: Mon, 08 Apr 1996 19:20
35 lines
1576 bytes
1576 bytes
Stefan Ludwig wrote:
> [deleted]
>
> The solution most in the "Spirit of Oberon" would be to drop WITH on pointers
> altogether.
> This was suggested in Szyperski's "ETHOS" thesis and discussed at the Institute
> at length. The reason we left it the way it is, was that too much System3 code
> would have needed a rewrite.
>
> I strongly advocate dropping WITH on pointers in commercial compilers.
> It's a hole in the type system, and it needs to be plugged!
XDS Oberon-2 (starting from v2.12) reports an error if the value of pointer may be changed
inside WITH, like in
TYPE
P = POINTER TO R;
R = RECORD i: INTEGER END;
P1 = POINTER TO R1;
R1 = RECORD (R) n: INTEGER END;
PROCEDURE proc1(p: P);
PROCEDURE proc2;
BEGIN
p:=NIL;
END proc2;
BEGIN
WITH p: P1 DO
proc2;
END;
END proc1;
I think it is better solution then dropping WITH on pointers.
-- Alex
Technical Details
Message-ID:
<318BAE1B.443@iis.nsk.su>Path:
arc1-ca.pugleaf.net!satisfy.kiae.su!KremlSun!fagot!tsiren!usenetReferences:
<2251891AH0002BF21H@p.froehlich.amc.cube.net> <4jrm9b$l8m@newsbf02.news.aol.com> <4jv1c1$drh@artemis.it.luc.edu> <4jvvs3$93h@lillian.inf.ethz.ch>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.oberon Path: arc1-ca.pugleaf.net!satisfy.kiae.su!KremlSun!fagot!tsiren!usenet From: Alex Nedorya <ned@iis.nsk.su> Subject: Re: The Trouble with WITH... Content-Type: text/plain; charset=us-ascii Sender: usenet@itfs.nsk.su (Deputy News Master) Content-Transfer-Encoding: 7bit Organization: IIS Message-ID: <318BAE1B.443@iis.nsk.su> References: <2251891AH0002BF21H@p.froehlich.amc.cube.net> <4jrm9b$l8m@newsbf02.news.aol.com> <4jv1c1$drh@artemis.it.luc.edu> <4jvvs3$93h@lillian.inf.ethz.ch> X-Mailer: Mozilla 2.01Gold (Win95; I) Mime-Version: 1.0 Cc: ned@iis.nsk.su X-Nntp-Posting-Host: 194.226.177.97 Date: Mon, 8 Apr 1996 19:20:59 GMT