- Problem with pointer semantics
----boundary-LibPST-iamunique-1525440093_-_-
Content-type: text/plain
This has to be a pretty standard problem in computer science, and it's not limited to BlackBox. Is there a good way to handle the following ambiguity? The problem is that you don't know by looking at an assignment statement what the results will be.
My own method is pretty ugly: I use Hungarian notation. Please tell me there's a better way. Thanks.
Rex Couture
==========
VAR
a, b: POINTER TO ARRAY OF INTEGER;
x, y: ARRAY 2 OF INTEGER;
NEW( a, 2); NEW( b, 2);
a[1]:= 1; b[1]:= 2;
x[1]:= 1; y[1]:= 2;
b:= a;
y:= x; (* not an equivalent statement *)
b[1]:= 5; (* a[1] = 5 *)
y[1]:= 5; (* x[1] = 1 *)
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-1525440093_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwICAgICAgICAgVGhpcyBoYXMgdG8gYmUgYSBwcmV0
dHkgc3RhbmRhcmQgcHJvYmxlbSBpbiBjb21wdXRlciBzY2llbmNlLCBhbmQgaXQncyBub3QgbGlt
aXRlZCB0byBCbGFja0JveC4gIElzIHRoZXJlIGEgZ29vZCB3YXkgdG8gaGFuZGxlIHRoZSBmb2xs
b3dpbmcgYW1iaWd1aXR5PyAgVGhlIHByb2JsZW0gaXMgdGhhdCB5b3UgZG9uJ3Qga25vdyBieSBs
b29raW5nIGF0IGFuIGFzc2lnbm1lbnQgc3RhdGVtZW50IHdoYXQgdGhlIHJlc3VsdHMgd2lsbCBi
ZS5ccGFyDQpccGFyDQogICAgICAgIE15IG93biBtZXRob2QgaXMgcHJldHR5IHVnbHk6ICBJIHVz
ZSBIdW5nYXJpYW4gbm90YXRpb24uICBQbGVhc2UgdGVsbCBtZSB0aGVyZSdzIGEgYmV0dGVyIHdh
eS4gIFRoYW5rcy5ccGFyDQpccGFyDQpSZXggQ291dHVyZVxwYXINClxwYXINCj09PT09PT09PT1c
cGFyDQpWQVJccGFyDQogICAgICAgIGEsIGI6IFBPSU5URVIgVE8gQVJSQVkgT0YgSU5URUdFUjtc
cGFyDQogICAgICAgIHgsIHk6IEFSUkFZIDIgT0YgSU5URUdFUjtccGFyDQpccGFyDQpORVcoIGEs
IDIpOyBORVcoIGIsIDIpO1xwYXINCmFbMV06PSAxOyAgYlsxXTo9IDI7XHBhcg0KeFsxXTo9IDE7
ICB5WzFdOj0gMjtccGFyDQpccGFyDQpiOj0gYTtccGFyDQp5Oj0geDsgKCogbm90IGFuIGVxdWl2
YWxlbnQgc3RhdGVtZW50ICopXHBhcg0KXHBhcg0KYlsxXTo9IDU7ICgqIGFbMV0gPSA1ICopXHBh
cg0KeVsxXTo9IDU7ICgqIHhbMV0gPSAxICopXHBhcg0KXHBhcg0KLS0tIEJsYWNrQm94XHBhcg0K
LS0tIHNlbmQgc3ViamVjdCBIRUxQIG9yIFVOU1VCU0NSSUJFIHRvIGJsYWNrYm94QG9iZXJvbi5j
aH19AGhhdCBpcyBleGE=
----boundary-LibPST-iamunique-1525440093_-_---
Received on Mon Jun 19 2006 - 21:20:56 UTC
This archive was generated by hypermail 2.3.0
: Thu Sep 26 2013 - 06:27:51 UTC