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

From: [at]} <Bernhard>
Date: Tue, 23 Aug 2011 00:06:02 +0200

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

Hi Doug,

> By writing SYSTEM.VAL(BYTE, schar) one is essentially doing
> schar := byte; and by passing the type checking mechanism.

yes, it is a type transfer (or in C terminology a type cast) ...

> One can write
> wr.WriteStore(m);
> rd.ReadStore(SYSTEM.VAL(Store, m));
> which is asymmetric in the treatment of writing and reading.

who writes it this way?

I still do not get the point. If I look at the Stores docu I find:

    Reader = RECORD
        rider-: Files.Reader;
        cancelled-: BOOLEAN;
        readAlien-: BOOLEAN;
        (VAR rd: Reader) ConnectTo (f: Files.File), NEW;
...
        (VAR rd: Reader) ReadStore (OUT x: Store), NEW;
...
    END;

    Writer = RECORD
        rider-: Files.Writer;
        writtenStore-: Store;
        (VAR wr: Writer) ConnectTo (f: Files.File), NEW;
...
        (VAR wr: Writer) WriteStore (x: Store), NEW;
...
    END;

which is completely symmetric. If there is a variable of type Store it can
be handed as parameter to wr.WriteStore and rd.ReadStore without any
need for SYSTEM.VAL ...

and in the source I find

PROCEDURE (VAR rd: Reader) ReadSChar* (OUT x: SHORTCHAR), NEW;
BEGIN
    rd.rider.ReadByte(SYSTEM.VAL(BYTE, x))
END ReadSChar;

and

PROCEDURE (VAR wr: Writer) WriteSChar* (x: SHORTCHAR), NEW;
BEGIN
    wr.rider.WriteByte(SYSTEM.VAL(BYTE, x))
END WriteSChar;

which is using SYSTEM.VAL but completely symmetric. It redirects the IO to
the corresponding rider (i.e. Files.Reader/Files.Writer). This pattern
(carrier/rider)
is best described in Clemens Szyperski's PhD Thesis page 38ff (available,
but not
searchable, since I did not have time for OCRing, on his pages at MicroSoft:
http://research.microsoft.com/en-us/um/people/cszypers/books/Insight-EthOS.pdf).

As I understand it, many design principles of BlackBox stem from the
research
documented in "Insight ETHOS".

regards
     Bernhard


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1710624189_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEhpIERvdWcsXHBhcg0KXHBhcg0KPiBCeSB3cml0
aW5nIFNZU1RFTS5WQUwoQllURSwgc2NoYXIpIG9uZSBpcyBlc3NlbnRpYWxseSBkb2luZ1xwYXIN
Cj4gc2NoYXIgOj0gYnl0ZTsgYW5kIGJ5IHBhc3NpbmcgdGhlIHR5cGUgY2hlY2tpbmcgbWVjaGFu
aXNtLlxwYXINClxwYXINCnllcywgaXQgaXMgYSB0eXBlIHRyYW5zZmVyIChvciBpbiBDIHRlcm1p
bm9sb2d5IGEgdHlwZSBjYXN0KSAuLi5ccGFyDQpccGFyDQo+IE9uZSBjYW4gd3JpdGVccGFyDQo+
ICAgICAgIHdyLldyaXRlU3RvcmUobSk7XHBhcg0KPiAgICAgICByZC5SZWFkU3RvcmUoU1lTVEVN
LlZBTChTdG9yZSwgbSkpO1xwYXINCj4gd2hpY2ggaXMgYXN5bW1ldHJpYyBpbiB0aGUgdHJlYXRt
ZW50IG9mIHdyaXRpbmcgYW5kIHJlYWRpbmcuXHBhcg0KXHBhcg0Kd2hvIHdyaXRlcyBpdCB0aGlz
IHdheT9ccGFyDQpccGFyDQpJIHN0aWxs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kgdW5kZXJzdGFuZCBpdCwgbWFueSBk
ZXNpZ24gcHJpbmNpcGxlcyBvZiBCbGFja0JveCBzdGVtIGZyb20gdGhlIFxwYXINCnJlc2VhcmNo
XHBhcg0KZG9jdW1lbnRlZCBpbiAiSW5zaWdodCBFVEhPUyIuXHBhcg0KXHBhcg0KcmVnYXJkc1xw
YXINCiAgICAgQmVybmhhcmRccGFyDQpccGFyDQpccGFyDQotLS0tXHBhcg0KVG8gdW5zdWJzY3Jp
YmUsIHNlbmQgYSBtZXNzYWdlIHdpdGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG8gTElTVFNF
UlZATElTVFMuT0JFUk9OLkNIfX0AaWJlLQ==
----boundary-LibPST-iamunique-1710624189_-_---
Received on Tue Aug 23 2011 - 00:06:02 UTC

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