Re: Real Time IO routines -- answering Simon Wright part 1



On Mon, 2007-10-29 at 19:28 +0000, anon wrote:

-- Basically, what's wrong with the IMAGE attribute?
--
-- Using IMAGE Attribute. Output formatted and style set by vendor
-- and the output format is not specified in Ada RM.

[examples of formatted I/O]

True, programming of formatted I/O of values in general
requires this approach. Text_IO.Editing is also quite
nice (though it is not available with every compiler...).

But, IO packages help with _formatted_ output of
non-String values. _Formatted_ output of simple String values
will, by comparison, require formatting efforts, too!
Same requirements, same approach. I can think of many good
reasons to just write unformatted string values to
Current_Output. (Which is 'Pseudo_Image for Strings ;-) [1]
For example, tabulation may require narrowing to columns,
paragraphs might have to be shaped, words truncated etc..
The circumstances are similar to those requiring numbers
with Aft, say.

So using 'Image or not seems a use case issue to me.
Seen from this point of view, the language, or some
notion of purity, cannot decide what the use case is.

Using IO packages can,
in my view, also be over the top when programmers apply their
stylistic preferences to external representations of output,
possibly, and unintentionally, hiding valuable information
that would in fact be produced by 'Image, if used with someone
else's Ada system.

[1] I guess this sounds silly, but I don't see numbers to be
special for the moment: For the reader, a word is an approximation
of a value, too.



.



Relevant Pages

  • Re: info version of Ada Reference Manual
    ... >info version of the Ada Reference Manual. ... >LRM (which has the Technical Corrigendum included), ... Info format is good for Emacs; it's close to plain text plus ... >vaguely-Scribe like source and generates RTF, HTML, or plain text. ...
    (comp.lang.ada)
  • Re: Representing image data
    ... writing code for each image format it wants to handle. ... I'm looking for suggestions on what the Ada interface to the ... for i in Image'range loop ... There are apparently means of setting its stack space allocation but I haven't ...
    (comp.lang.ada)
  • Re: Representing image data
    ... There is an Ada binding ... writing code for each image format it wants to handle. ... There are various libraries, full Ada ...
    (comp.lang.ada)
  • Re: Format string bugs & race conditions
    ... No. Using files for locks is equally easy to implement and equally buggy ... But in Ada you would implement a lock as a protected ... Regarding format strings my experience confirms that the C approach is ...
    (comp.lang.ada)
  • info version of Ada Reference Manual
    ... website for the current ... Info format is good for Emacs; it's close to plain text plus ... The current manual is generated by some Ada code that reads the ... vaguely-Scribe like source and generates RTF, HTML, or plain text. ...
    (comp.lang.ada)