RE: [BLACKBOX] SYSTEM.VAL, WITH, IS, and type casting

From: null <">
Date: Tue, 23 Aug 2011 07:25:08 +0000

----boundary-LibPST-iamunique-1131959585_-_-
Content-type: text/plain

Hi Doug,

> -----Original Message-----
[...]
> PROCEDURE ReadMyObject (VAR rd: Reader, OUT x: MyObject);
> BEGIN
> rd.ReadStore(SYSTEM.VAL(Stores.Store, x))
> END;
>
> PROCEDURE WriteMyObject (VAR wr: Writer, x: MyObject);
> BEGIN
> wr.WriteStore(SYSTEM.VAL(Stores.Store, x))
> END;
>
> Although WriteMyObject is superfluous since one can already
> just write.
> wr.WriteStore(x)
> as long as x is an extension of Stores.Store.
>

although I am a bit uncertain, I still fear that you have to resort
to low level stuff at this stage (and we are back at the problem
outlined by Hanspeter M. about storing and retrieving objects) since
you normally don't know what kind of extension you're reading and
you can't decide which one it is. If you write your MyObject (which
I asume to be an extension of Stores.Store) as a Stores.Store you
loose all information of the extended object. When retrieving it
you have a Stores.Store with all additional information lost.

If you have an object of static type Store, you can test for its
dynamic type when writing, but you cannot when reading ...
I think here the asymmetry stems from.

hope this helps ...
--
  Bernhard 
----boundary-LibPST-iamunique-1131959585_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEhpIERvdWcsXHBhcg0KXHBhcg0KPiAtLS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c2lvbiB5b3UncmUgcmVhZGlu
ZyBhbmRccGFyDQp5b3UgY2FuJ3QgZGVjaWRlIHdoaWNoIG9uZSBpdCBpcy4gSWYgeW91IHdyaXRl
IHlvdXIgTXlPYmplY3QgKHdoaWNoXHBhcg0KSSBhc3VtZSB0byBiZSBhbiBleHRlbnNpb24gb2Yg
U3RvcmVzLlN0b3JlKSBhcyBhIFN0b3Jlcy5TdG9yZSB5b3UgXHBhcg0KbG9vc2UgYWxsIGluZm9y
bWF0aW9uIG9mIHRoZSBleHRlbmRlZCBvYmplY3QuIFdoZW4gcmV0cmlldmluZyBpdFxwYXINCnlv
dSBoYXZlIGEgU3RvcmVzLlN0b3JlIHdpdGggYWxsIGFkZGl0aW9uYWwgaW5mb3JtYXRpb24gbG9z
dC5ccGFyDQpccGFyDQpJZiB5b3UgaGF2ZSBhbiBvYmplY3Qgb2Ygc3RhdGljIHR5cGUgU3RvcmUs
IHlvdSBjYW4gdGVzdCBmb3IgaXRzXHBhcg0KZHluYW1pYyB0eXBlIHdoZW4gd3JpdGluZywgYnV0
IHlvdSBjYW5ub3Qgd2hlbiByZWFkaW5nIC4uLlxwYXINCkkgdGhpbmsgaGVyZSB0aGUgYXN5bW1l
dHJ5IHN0ZW1zIGZyb20uXHBhcg0KXHBhcg0KaG9wZSB0aGlzIGhlbHBzIC4uLlxwYXINCi0tXHBh
cg0KICBCZXJuaGFyZCB9fQBufgAe
----boundary-LibPST-iamunique-1131959585_-_---
Received on Tue Aug 23 2011 - 09:25:08 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:11 UTC