[BLACKBOX] Storing an extended object

From: Douglas G. Danforth <"Douglas>
Date: Mon, 10 Nov 2008 15:20:32 -0800

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

I am not quite sure how to implement the Externalize and Internalize
procedures
for objects that are an extension of a base type. If I write an
Externalize procedure
(one for the base and one for the extension) then BB complains. So must
I do something
like the following?

    TYPE
       Base = POINTER TO EXTENSIBLE RECORD(Stores.Store)
           data: INTEGER
           END;
       Sub = POINTER TO RECORD(Base)
          moreData: INTEGER;
          END;

    PROCEDURE (base: Base) Externalize- (VAR wr: Stores.Writer);
    BEGIN
       wr.WriteInt(base.data);
       WITH base: Sub DO
          wr.WriteInt(base.moreData);
       ELSE
       END
    END Externalize;

But now when I internalize what must I do?

This seems cumbersome and not very elegant.
-Doug Danforth


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1608937079_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEkgYW0gbm90IHF1aXRlIHN1cmUgaG93IHRvIGlt
cGxlbWVudCB0aGUgRXh0ZXJuYWxpemUgYW5kIEludGVybmFsaXplIFxwYXINCnByb2NlZHVyZXNc
cGFyDQpmb3Igb2JqZWN0cyB0aGF0IGFyZSBhbiBleHRl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YXIN
Ci0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwgc2VuZCBhIG1lc3NhZ2Ugd2l0aCBib2R5ICJTSUdO
T0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST04uQ0h9fQAAABoA
----boundary-LibPST-iamunique-1608937079_-_---
Received on Tue Nov 11 2008 - 00:20:32 UTC

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