comp.lang.ada
 help / color / mirror / Atom feed
* text_io.Put_line behaviour on failure
@ 2015-12-04 14:43 pettylarsony
  2015-12-04 15:12 ` AdaMagica
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: pettylarsony @ 2015-12-04 14:43 UTC (permalink / raw)


Having searched the ADA documentation and goolged extensively I cannot find any definition of how this function behaves under a failure condition or even if it can fail.

Example. Text_IO.Output is re-directed to a file. The disc on which the file resides becomes full, the file is deleted, or the file is set read_only.. the first instance is the most likely case to cause a failure..

So what happens when you call Put_Line("Some arbitrary text string")?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: text_io.Put_line behaviour on failure
  2015-12-04 14:43 text_io.Put_line behaviour on failure pettylarsony
@ 2015-12-04 15:12 ` AdaMagica
  2015-12-04 15:27 ` G.B.
  2015-12-04 18:57 ` Jeffrey R. Carter
  2 siblings, 0 replies; 4+ messages in thread
From: AdaMagica @ 2015-12-04 15:12 UTC (permalink / raw)


See the highly classified documentation at this secret place:
Ada Reference Manual http://ada-auth.org/arm.html
For instance A.13


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: text_io.Put_line behaviour on failure
  2015-12-04 14:43 text_io.Put_line behaviour on failure pettylarsony
  2015-12-04 15:12 ` AdaMagica
@ 2015-12-04 15:27 ` G.B.
  2015-12-04 18:57 ` Jeffrey R. Carter
  2 siblings, 0 replies; 4+ messages in thread
From: G.B. @ 2015-12-04 15:27 UTC (permalink / raw)


On 04.12.15 15:43, pettylarsony@gmail.com wrote:
> Having searched the ADA documentation and goolged extensively I cannot find any definition of how this function behaves under a failure condition or even if it can fail.
>
> Example. Text_IO.Output is re-directed to a file. The disc on which the file resides becomes full, the file is deleted, or the file is set read_only.. the first instance is the most likely case to cause a failure..
>
> So what happens when you call Put_Line("Some arbitrary text string")?
>

External conditions like disks being full would not
typically be handled by any languages run-time system:
Since the language's definition does not even assume
an operating system, or disks, little is fixed in this
regard.

The effect may be even more out of reach of the language
proper if during translation of the program nothing is
decided, like Standard_Output later being redirected in
some shell script, or not, say.

Handling properties of specific OS's behavior will need
linking with OS procedures, I'd think. E.g., the "disk
full" condition may not even have a physical counterpart,
insofar as the root user of Unix-like OSs may still have
some 5% left where other OS UIDs have run out of "disk space".
This would not be the subject of a language definition,
neither of Ada nor of C., etc.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: text_io.Put_line behaviour on failure
  2015-12-04 14:43 text_io.Put_line behaviour on failure pettylarsony
  2015-12-04 15:12 ` AdaMagica
  2015-12-04 15:27 ` G.B.
@ 2015-12-04 18:57 ` Jeffrey R. Carter
  2 siblings, 0 replies; 4+ messages in thread
From: Jeffrey R. Carter @ 2015-12-04 18:57 UTC (permalink / raw)


On 12/04/2015 07:43 AM, pettylarsony@gmail.com wrote:
> Having searched the ADA documentation and goolged extensively I cannot find
> any definition of how this function behaves under a failure condition or even
> if it can fail.

The language is named for a woman named Ada. It is not an acronym.

The behavior of Put_Line is defined in ARM Annex A. I/O error handling is
defined in ARM A.13:

http://www.adaic.org/resources/add_content/standards/12rm/html/RM-A-13.html

Some of this is, of course, implementation dependent, and you'd need to refer to
the documentation required under "Documentation Requirements" to see how your
implementation handles specific cases. I'd expect Use_Error to be raised for the
examples you cited.

-- 
Jeff Carter
"Well, a gala day is enough for me. I don't think
I can handle any more."
Duck Soup
93

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-04 18:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-04 14:43 text_io.Put_line behaviour on failure pettylarsony
2015-12-04 15:12 ` AdaMagica
2015-12-04 15:27 ` G.B.
2015-12-04 18:57 ` Jeffrey R. Carter

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