comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: fixed point types over an interface
Date: 1997/02/12
Date: 1997-02-12T00:00:00+00:00	[thread overview]
Message-ID: <dewar.855763110@merv> (raw)
In-Reply-To: rcawwsedshp.fsf@quasimodo.enst.fr


Laurent Pautet said

<<GLADE is only 95% XDR in order to follow LRM requirements. The 5%
comes from the XDR 4 bytes rule (basically strings).>>

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.






  reply	other threads:[~1997-02-12  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-07  0:00 fixed point types over an interface Allen Krell
1997-02-07  0:00 ` Matthew Heaney
1997-02-07  0:00 ` Robert Dewar
1997-02-10  0:00   ` Mats Weber
1997-02-10  0:00     ` Robert Dewar
1997-02-11  0:00       ` nassera
1997-02-12  0:00         ` Samuel Tardieu
1997-02-12  0:00   ` Laurent Pautet
1997-02-12  0:00     ` Robert Dewar [this message]
1997-02-12  0:00       ` Mats Weber
1997-02-17  0:00     ` Jacob Sparre Andersen
1997-02-18  0:00       ` Robert Dewar
1997-02-12  0:00   ` Jon S Anthony
1997-02-12  0:00   ` Laurent Pautet
1997-02-13  0:00   ` Jon S Anthony
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox