Re: violating procedure calling convention
- From: Tak-Shing Chan <t.chan@xxxxxxxxxx>
- Date: Fri, 13 Apr 2007 18:15:08 +0100
On Fri, 13 Apr 2007, Dave Vandervies wrote:
In article <1176482095.827441.157060@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
KIRAN <kiraank@xxxxxxxxx> wrote:
hi,
the grammer for any programming language says that when a function is
called by another function,the callee after executing it's body should
return to the point where it left in the caller..
The grammar says no such thing. The grammar only describes syntax;
what happens when it runs is a matter of semantics.
Is there any technique to make the callee to return to some other
point(within the current process) other than the callee by changing
the call stack in callee...
Use INTERCAL, which has a COME FROM statement for precisely this purpose.
Alternatively, use a functional programming language that lets you use
explicit continuations and invoke a continuation instead of returning.
Both of these can be done in (correct, portable) C if you try hard enough,
but You Don't Want To Do That. Either re-frame the problem to fit your
tools or choose your tools to fit the problem.
I don't quite agree with this anti-goto mentality.
In some cases, setjmp and longjmp are actually better than
reframing the problem.
Tak-Shing
.
- Follow-Ups:
- Re: violating procedure calling convention
- From: Dave Vandervies
- Re: violating procedure calling convention
- References:
- violating procedure calling convention
- From: KIRAN
- Re: violating procedure calling convention
- From: Dave Vandervies
- violating procedure calling convention
- Prev by Date: Running ping
- Next by Date: Re: Running ping
- Previous by thread: Re: violating procedure calling convention
- Next by thread: Re: violating procedure calling convention
- Index(es):
Relevant Pages
|