----boundary-LibPST-iamunique-1499751563_-_-
Content-type: text/plain
Hi Bob,
I think this is a bug.
The compiler should complain, when an IN parameter is handed
as a VAR receiver down to another procedure.
The compiler correctly complains with either of the following:
Box.k := 5 in Salt
and
PROCEDURE Pepper ( VAR box : Box);
...
Pepper(box) in Salt
Regards
Bernhard
>-----Original Message-----
>From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy>Campbell, Robert (SELEX GALILEO, UK)
>Sent: Monday, August 06, 2012 4:05 PM
>To: BLACKBOX{([at]})nowhere.xy>Subject: [BLACKBOX] Variable IN parameters !
>
>
>Hello
>
>After the first line box.k is 17. Then a call to 'Salt' changes it to 5 even though
>box is
>an IN parameter, which I thought meant that it could not be changed.
>
>(If box contained POINTERs I knew that the things pointed to could be
>changed, but
>I thought that the (*direct*) contents of box should be read-only.)
>
>Is this a bug? - or just a trap for the unwary?
>
>
>Regards
>
>Robert
>
>
>
>MODULE RdcTestOne;
>
>IMPORT StdLog;
>
>TYPE
> Box = RECORD
> k : INTEGER
> END;
>
>PROCEDURE (VAR box : Box) Pepper, NEW;
> BEGIN
> box.k := 5
> END Pepper;
>
>PROCEDURE (IN box : Box) Salt, NEW;
> BEGIN
> box.Pepper
> END Salt;
>
>PROCEDURE Do*;
> VAR
> box : Box;
> BEGIN
> box.k := 17; StdLog.Int (box.k); StdLog.Ln;
> box.Salt; StdLog.Int (box.k); StdLog.Ln
> END Do;
>
>END RdcTestOne.
>
>SELEX Galileo Ltd
>Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex
>SS14 3EL
>A company registered in England & Wales. Company no. 02426132
>***********************************************************
>*********
>This email and any attachments are confidential to the intended
>recipient and may also be privileged. If you are not the intended
>recipient please delete it from your system and notify the sender.
>You should not copy it or use it for any purpose nor disclose or
>distribute its contents to any other person.
>***********************************************************
>*********
>
>
>----
>To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
>LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1499751563_-_-
Content-type: application/r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bWFpbCBhbmQgYW55IGF0dGFjaG1lbnRzIGFyZSBjb25maWRl
bnRpYWwgdG8gdGhlIGludGVuZGVkXHBhcg0KPnJlY2lwaWVudCBhbmQgbWF5IGFsc28gYmUgcHJp
dmlsZWdlZC4gSWYgeW91IGFyZSBub3QgdGhlIGludGVuZGVkXHBhcg0KPnJlY2lwaWVudCBwbGVh
c2UgZGVsZXRlIGl0IGZyb20geW91ciBzeXN0ZW0gYW5kIG5vdGlmeSB0aGUgc2VuZGVyLlxwYXIN
Cj5Zb3Ugc2hvdWxkIG5vdCBjb3B5IGl0IG9yIHVzZSBpdCBmb3IgYW55IHB1cnBvc2Ugbm9yIGRp
c2Nsb3NlIG9yXHBhcg0KPmRpc3RyaWJ1dGUgaXRzIGNvbnRlbnRzIHRvIGFueSBvdGhlciBwZXJz
b24uXHBhcg0KPioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqXHBhcg0KPioqKioqKioqKlxwYXINCj5ccGFyDQo+XHBhcg0KPi0tLS1ccGFy
DQo+VG8gdW5zdWJzY3JpYmUsIHNlbmQgYSBtZXNzYWdlIHdpdGggYm9keSAiU0lHTk9GRiBCTEFD
S0JPWCIgdG9ccGFyDQo+TElTVFNFUlZATElTVFMuT0JFUk9OLkNIXH19APAjOg==
----boundary-LibPST-iamunique-1499751563_-_---
BEGIN:VCARD
FN:(null)
N:;;;;
VERSION: 3.0
END:VCARD
Received on Tue Aug 07 2012 - 13:44:42 UTC