Re: [BLACKBOX] SYSTEM.VAL, WITH, IS, and type casting
----boundary-LibPST-iamunique-483314942_-_-
Content-type: text/plain
On 8/23/2011 12:25 AM, Treutwein Bernhard wrote:
Hi Doug,
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 ...
I believe when one writes wr.WriteStore(x) the dynamic type of x is written to the file
so that when it is read as rd.ReadStore(store) the dynamic type is recovered otherwise
doing a type cast x := store(MyObject) would not make sense.
Again, I am simply still musing over the consequences of using SYSTEM.VAL.
In fact I have adopted the method when I use my AbstractLists.List which has
a Reader of the list just like a file has a reader or a stores has a reader.
My three reader functions are
rd.ConnectTo(list)
rd.First;
WHILE rd.Next(SYSTEM.VAL(AbstractLists.Object, myObject)) DO ... END;
and I need only one variable "myObject" rather than two where myObject is an
extension of AbstractLists.Object.
-Doug
---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
----boundary-LibPST-iamunique-483314942_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbWh0bWwxIFxkZWZmMHtcZm9udHRibA0Ke1xmMFxm
c3dpc3NcZmNoYXJzZXQwIEFyaWFsO30NCntcZjFcZm1vZGVybiBDb3VyaWVyIE5ldzt9DQp7XGYy
XGZuaWxcZmNoYXJzZXQyIFN5bWJvbDt9DQp7XGYzXGZtb2Rlcm5cZmNoYXJzZXQwIENvdXJpZXIg
TmV3O319DQp7XGNvbG9ydGJsXHJlZDBcZ3JlZW4wXGJsdWUwO1xyZWQwXGdyZWV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