From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b9c9ba98cff47596 X-Google-Attributes: gid103376,public From: Jim Rogers Subject: Re: Message passing code Date: 1999/06/28 Message-ID: <7l7sk5$ggl$1@nnrp1.deja.com>#1/1 X-Deja-AN: 494742958 References: <7ksh2u$e1e2@svlss.lmms.lmco.com> <7ktlts$a7g$1@nnrp1.deja.com> <3772AD75.F5E8AAED@hiwaay.net> <7l0gj5$b62$1@nnrp1.deja.com> <7l0s5k$g32$1@nnrp1.deja.com> <7l6lni$4a5$1@nnrp1.deja.com> X-Http-Proxy: 1.1 x23.deja.com:80 (Squid/1.1.22) for client 205.170.64.211 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Mon Jun 28 13:17:01 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; EXCITE) Date: 1999-06-28T00:00:00+00:00 List-Id: In article <7l6lni$4a5$1@nnrp1.deja.com>, Robert Dewar wrote: > In article <7l0s5k$g32$1@nnrp1.deja.com>, > Ted Dennison wrote: > > > Unless you write them yourself, you don't know how 'Read and > > 'Write are converting between your objects and stream > > elements. > > I certainly HOPE this is false with any reasonable Ada 95 > compiler. It should be quite transparent what the conversion > mechanism is. In the case of GNAT, you can look at s-stratt.adb > which encapsulates the conversions used (we have two versions > that are standard, and easy to read and understand, one for > native format, and one which uses XDR for platform > independence). You can if you like write your own version of > s-stratt.adb to control the underlying default translations > that are used. Unfortunately, I have had some nasty surprises in this area from ObjectAda. Example: type Byte is mod 2**8; for Byte'Size use 8; I assumed that the native stream representation of the above type would be represented in 8 bits. In fact it is represented on the stream in 32 bits. The only way I could assure that this type would occupy only 8 bits in my stream was to write customized 'Read and 'Write procedures. Aonix calls this a feature. They use the Intermetrics front end. Apparently this is the behavior preferred by Tucker Taft, who insists that the stream should represent all values by the size of the Base type, and the Base type for all integer types is Universal Integer. This is my understanding of the Aonix rationale. I am sure I will be corrected if I am wrong. -- Jim Rogers Colorado Springs, Colorado USA Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.