Re: goto return ?
- From: mlists@xxxxxxxxxxxxxxx (JupiterHost.Net)
- Date: Fri, 24 Nov 2006 17:37:35 -0600
Tom Phoenix wrote:
On 11/24/06, JupiterHost.Net <mlists@xxxxxxxxxxxxxxx> wrote:
The trick is I can't seem to goto() return in
do_some_stuff_and_return(), I'm sure since its so deep down...
Are you saying that you want a subroutine that can make the subroutine
that called *it* return? I'm not sure that that would make sense; and
it's not something that anybody's style guide recommends for normal
programming, since it leads to some ambiguous situations.
There's probably a better way to structure your algorithm. Or maybe
I've misunderstood your situation. Good luck with it!
Thanks Tom, I'll try to clarify.
In a function I can do this:
# stuff here
if($whatever, @ret) {
one();
two();
goto &CORE::return; # this is pseudo code that does not work but illustrates the idea of the goal
}
# keep going since that function didn't return.
Say you have to do that expect same logic ten times, it'd be nice instead of fifty of the exact same lines to have ten lines by do ing this:
# stuff here
do_one_then_two_then_return_if($whatever);
# keep going since that function didn't return.
Just need to figure you how to get the functionality that:
goto &CORE::return;
feels like it should do assuming I knew how to reference return...
.
- Follow-Ups:
- Re: goto return ?
- From: Paul Johnson
- Re: goto return ?
- From: Mumia W.
- Re: goto return ?
- References:
- goto return ?
- From: JupiterHost.Net
- Re: goto return ?
- From: Tom Phoenix
- goto return ?
- Prev by Date: Re: goto return ?
- Next by Date: Re: failed substitution
- Previous by thread: Re: goto return ?
- Next by thread: Re: goto return ?
- Index(es):
Relevant Pages
|