Re: Real Time IO routines



Adam Beneschan a écrit :
Sorry, that's just nonsense. The semantics and result of 'Image are
well-defined by the language. If those semantics are acceptable for a
particular use, then there's nothing wrong with using 'Image (unless
there's an issue with using a secondary stack as Ludovic mentioned).
If they're not, then don't use it. 'Image does not return things in a
way that makes it amenable to nicely formatted reports where things
line up. (If you are creating a report with real numbers where you
want all the decimal points to line up, 'Image is probably not
best.) Other than that, I can see no reason not to use 'Image

There is an important reason that many people forget. Compare:
put_line (Integer'image(I));
with
put (I); -- Assuming proper instantiation of Integer_IO

If the line length is bounded and there remains not enough space on the line to accomodate the number, the former will write the number "across" the line break, while the latter will insert a EOL mark before the number and write the whole number on the next line.

--
---------------------------------------------------------
J-P. Rosen (rosen@xxxxxxxxx)
Visit Adalog's web site at http://www.adalog.fr
.



Relevant Pages

  • Re: Real Time IO routines
    ... Adam Beneschan writes: ... well-defined by the language. ... If those semantics are acceptable for a ... 'Image of enumeration literals does not print what appears in the source ...
    (comp.lang.ada)
  • Re: Real Time IO routines
    ... Adam Beneschan writes: ... well-defined by the language. ... If those semantics are acceptable for a ... in Ada 95. ...
    (comp.lang.ada)