Re: Real Time IO routines



Adam Beneschan <adam@xxxxxxxxxx> writes:
On Oct 29, 9:40 am, Robert A Duff <bobd...@xxxxxxxxxxxxxxxxxxxx>
wrote:
Adam Beneschan <a...@xxxxxxxxxx> writes:
... 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).

True. But it's pretty annoying that:

'Image of integers includes an unwanted leading space.
[...]
As for #1, I've often written my own function that declares a string S
whose value is 'Image and then returns S(S'First+1..S'Last) to get rid
of the leading space---this was before Trim functions became available
in Ada 95.

I hope you check that the value is non-negative before deleting the
first character.

[...]

I believe GNAT does have an 'Img attribute that can be applied to an
object (although I assume you still need 'Image for certain types of
expressions that are not valid attribute prefixes). I don't know
whether this was ever proposed as a language addition, and if so why
it was rejected.

GNAT's 'Img does the same leading-space thing that the standard 'Image
does.

--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.



Relevant Pages

  • Re: object system...
    ... conflict with the actual sun and stars (so, ... Interface too can have some properties defined in terms of third types ... not the language or its target. ... If you ignore overflow exceptions, then necessary, the semantics becomes ...
    (comp.object)
  • Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada)
    ... >>language containing many unsafe features, ... >>in Ada. ... >>it at hand anyway, but the gist of it is that, in Ada, loop variables ... in C/C++ compilers in how through language semantics are adhered to. ...
    (comp.lang.ada)
  • Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada)
    ... >>language containing many unsafe features, ... >>in Ada. ... >>it at hand anyway, but the gist of it is that, in Ada, loop variables ... in C/C++ compilers in how through language semantics are adhered to. ...
    (comp.lang.cpp)
  • Re: Code Comprehension
    ... Given a language like C, where the actual semantics differ quite ... you because of your level of familiarity. ... producing correct code and other sets of semantics that don't. ...
    (comp.programming)
  • Re: what follows from denying an axiom
    ... Chris Menzel is the first person I have ever heard say "second-order ... language purely syntactically. ... Formal system has no semantics. ... to the resultant perception-phenomenon known as relativity, ...
    (sci.logic)