Re: Final Procedure
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Sat, 29 Nov 2008 15:30:43 -0800
Gary Scott <garylscott@xxxxxxxxxxxxx> wrote:
Gary Scott schrieb:
Why must a final procedure be a subroutine (not a function)?
It kind of violates some coding standards where the return code/value
is always required as an "error code" (success/failure). I think you
might still want to know success/failure as a general standard practice.
I can imagine it returning such to the operating system.
Well, since you don't invoke final procedures, you couldn't get the
result from them anyway. Nor is there any obvious place for the systen
to get it; it isn't as though there is a single final procedure that
gives a single result that could be the program return value. There are,
in general, countless final procedures executed during a program. I
suppose one could specify that whenever any of them returned anything
other than 0 (or whatever other value you wanted to indicate sucess),
the standard could specify that the program would imediately
terminate... or something... but...
Generally speaking, you are describing a C coding style anyway. The
Fortran standard at the least discourages using function return values
as error codes. There are infinite debates (which I won't participate in
if this restarts one) about exactly what cases it is legal in, but by
making even some cases illegal, the standard can be said to at least
discourage the practice. It would be highly inconsistent for the
standard to then go and specify the practice for final procedures; sure
the standard is inconsistent about some things, but don't hold your
breath waiting for this particular inconsistency to happen.
--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: Final Procedure
- From: nmm1
- Re: Final Procedure
- From: Gary Scott
- Re: Final Procedure
- References:
- Final Procedure
- From: Gary Scott
- Re: Final Procedure
- From: Reinhold Bader
- Re: Final Procedure
- From: Gary Scott
- Final Procedure
- Prev by Date: CLASS Terminology
- Next by Date: Re: Final Procedure
- Previous by thread: Re: Final Procedure
- Next by thread: Re: Final Procedure
- Index(es):
Relevant Pages
|