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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d2c23a44c4c8fd6b X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: fixed point types over an interface Date: 1997/02/12 Message-ID: #1/1 X-Deja-AN: 218280140 References: <32FBB550.41C67EA6@efogm.msd.ray.com> <32FF352D.3EA1@elca-matrix.ch> <5drd56$90i@lana.zippo.com> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-02-12T00:00:00+00:00 List-Id: Laurent Pautet said <> This is confusing and misleading. It is true that a string is not output in XDR format, but that is because strings are not output in streams ever. Instead the semantics of Ada is that a string is output as a series of characters. These characters are indeed output in the format required by XDR. Yes, you might expect that a string in Ada would be output in a format corresponding to a string as described in the XDR standard, but really there is no reason to expect such a correspondence. Clearly a string in Ada is a rather different beast, because for one thing it typically includes bounds. So, here is the exact statement of what is going on: When the default stream attribtutes are used, the operates are first broken down into a series of operations on primitive data values. The rules for this breakdown are part of the Ada rules, and hence streams in Ada have no requirement for dealing with composite values, since they are defined to be a sequence of primitive values. These primitive values are written in accordance with the rules in the XDR standard, which are followed 100% accurately. If you want to intercommunicate with another language, that other language must understand the sequence of items that is written into the stream. For example if we use 'Output on a four character string with bounds 1..4, then six elements are written: lower bound upper bound first character second character third character fourth character each of these six elements is represented using the XDR standard. The "other language" code must read these six elements and assemble them into whatever makes best sense for representing this particular aggregate data item.