🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4846

Re: Error in PD Modula-2 compiler? Or just in my brain?

#4846
From: Pat Terry
Date: Tue, 30 May 1989 05:46
37 lines
1804 bytes
 > In article <340@actisb.UUCP>, federico@actisb.UUCP (Federico Heinz) 
 > writes:

 > >   Yesterday I was attempting to solve a quite nonsensical university
...
 > >  BEGIN
 > >    CreateList(list);  (* VAR parameters must be of IDENTICAL types *) 
 > >    newStack := list;  (* this needs only assignment compatibility  *)
 > >     END CreateStack;
 > > 
 > >     (...)
 > > 
 > >     END Stacks;
 > > 
 > >   To my surprise, the compiler flagged an 'illegal assignment' on the
 > > line 'newStack := list'. ...

Although in PIM Wirth wrote

   Assignment and test for equality are applicable to all opaque types.

some folk seem to feel that these operations are "misleading" (a test for
equality seems to imply conceptually a test for equality of the objects
pointed at, rather than of the addresses).  So perhaps some systems have
decided to rule out these operations as a result?  Of course actual
value parameters really imply an initial assignment anyway ... !

Does your compiler allow the (in)equality tests?  What if you try

    IF list = list THEN END;
 


--  
uucp: {mcvax!uunet,tektronix,sun!nosun}!oresoft!dawggon!2!490!19.101!Pat.Terry
Internet: Pat.Terry@p101.f19.n490.z2.fidonet.org
Technical Details
Message-ID: <1892.2482000C@dawggon.fidonet.org>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!indri!lll-winken!uunet!zephyr!tektronix!percival!qiclab!m2xenix!dawggon!p101.f19.n490.z2.fidonet.org!Pat.Terry

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!indri!lll-winken!uunet!zephyr!tektronix!percival!qiclab!m2xenix!dawggon!p101.f19.n490.z2.fidonet.org!Pat.Terry
From: Pat.Terry@p101.f19.n490.z2.fidonet.org (Pat Terry)
Newsgroups: comp.lang.modula2
Subject: Re: Error in PD Modula-2 compiler? Or just in my brain?
Message-ID: <1892.2482000C@dawggon.fidonet.org>
Date: 30 May 89 05:46:18 GMT
Sender: ufgate@dawggon.fidonet.org (newsout1.26)
Organization: FidoNet node 2:490/19.101 - Settler City Fido, Grahamstown RSA
Lines: 37