Re: Get_Line problem (GNAT bug?)



Dmitry A. Kazakov a écrit :
The rules of thumb I suppose I and many other Ada programmers are using:

1. Never ever use End_Of_File with text files;
2. If you yet use End_Of_File then do it for *each* character of the file;
3. As Adam has suggested, End_Error exception is the right design;
4. End_Error is not only cleaner and correct, but also more efficient.

And I'll add another one:
5. End_Error works correctly with badly formed files, i.e. files whose
last line does not end with and end-of-line mark. You can get strange behaviour in that case with any other solution.

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



Relevant Pages

  • Re: The origins of CL conditions system
    ... Machine experience explaining the Lisp Machine error handling. ... languages with continuable exceptions (including Mary Fontana from TI ... Why can't I resume after catching an exception? ... exception handling chapter of The Design and Evolution of C++. ...
    (comp.lang.lisp)
  • Re: Making Life From Scratch, If the Creator Can Do It, It Must Be Easy
    ... There are two distinct meanings of design at play. ... Meaning 1) In one, ... at how fractals of great similarity can at multiple levels of scale. ... Adam I and Adam II - ...
    (talk.origins)
  • The Reason Why LOGOS Went Away is Obvious: Here it is
    ... There are two distinct meanings of design at play. ... This meaning of design simply says ... Here I assume you are referring to fractals as creating a design ... Adam I and Adam II - representing ...
    (talk.origins)
  • Re: CInternetSession
    ... the presence of the Sleepindicates the serious design flaw. ... Sleep() calls around like pixie dust, your design is fundamentally broken and will need to ... If you use Sleepin a loop, your design is probably wrong and needs to be ... The "First Chance Exception" message usually indicates nothing harmful. ...
    (microsoft.public.vc.mfc)
  • Re: [announcement] SYSAPI and SYSSVC for Windows
    ... Windows is the actual design problem, ... exception would just have to be a tagged type. ... Observe that the following is absolutely legal and works in Ada: ... The compiler checks that Data_Error cannot propagate out of f. ...
    (comp.lang.ada)