Re: Use of subroutines
From: Pterostyrax (pterostyrax_at_yahoo.com)
Date: 02/29/04
- Next message: Pterostyrax: "Re: Use of subroutines"
- Previous message: Pterostyrax: "Re: Use of subroutines"
- In reply to: Kevin G. Rhoads: "Re: Use of subroutines"
- Next in thread: Kevin G. Rhoads: "Re: Use of subroutines"
- Reply: Kevin G. Rhoads: "Re: Use of subroutines"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Feb 2004 15:03:18 -0800
"Kevin G. Rhoads" <Kevin.Rhoads@Dartmouth.edu> wrote in message news:<4040D2AE.421B18DB@Dartmouth.edu>...
> >I still maintain that a subroutine is first and foremost a GOTO
> >statement.
>
> GOTO transfers control with no provision to return and continue
> execution.
>
> CALL transfers control with built-in provision to return and
> continue execution.
>
> In assembly programming, this may be the only difference.
> In HLL programming, the subroutine has a different context,
> name space, variable scoping and may or may not have a
> different run-time address space.
>
> These are not the only differences, but they are highly
> non-trivial differences.
>
> Q1: Had you heard of any of these before?
> Q2: Do you understand what these things mean?
>
> If you cannot answer with an unreserved "yes" to
> both, then I think you need to learn of these
> concepts and issues before proceeding.
>
> I'd be happy to take a crack at answering if
> you have questions on any of the above, just
> ask.
>
> Sincerely
> Kevin
Well, first, all my comments have been with reference to Fortran - I
assumed that every one else would make that assumption in a Fortran
newsgroup. I never originally stated that GOTOs were EXACTLY the same
as a subroutine. I merely pointed out that CALLs to subroutines
behaved exactly like GOTOs when looking at logic flow in a program.
RETURNs behave exactly the same as well. Of course there are a number
of differences between the two and I am surprised that you could
interpret my original post in that way.
- Next message: Pterostyrax: "Re: Use of subroutines"
- Previous message: Pterostyrax: "Re: Use of subroutines"
- In reply to: Kevin G. Rhoads: "Re: Use of subroutines"
- Next in thread: Kevin G. Rhoads: "Re: Use of subroutines"
- Reply: Kevin G. Rhoads: "Re: Use of subroutines"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|