Re: goto return ?
- From: paul@xxxxxxxx (Paul Johnson)
- Date: Sat, 25 Nov 2006 11:40:20 +0100
On Fri, Nov 24, 2006 at 05:37:35PM -0600, JupiterHost.Net wrote:
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
More than twice I think I'd expect some sort of loop.
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);
do { one_then_two; return } if $whatever;
one_then_two, return if $whatever;
if ($whatever) { one_then_two; return }
$whatever and one_then_two, return;
or maybe the return is conditional:
return if $whatever && one_then_two;
$whatever and one_then_two and return;
or maybe you want to return a value:
return one_then_two if $whatever;
or any of a number of variations.
# 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...
nah
--
Paul Johnson - paul@xxxxxxxx
http://www.pjcj.net
.
- Follow-Ups:
- Re: goto return ?
- From: JupiterHost.Net
- Re: goto return ?
- References:
- goto return ?
- From: JupiterHost.Net
- Re: goto return ?
- From: Tom Phoenix
- Re: goto return ?
- From: JupiterHost.Net
- goto return ?
- Prev by Date: Re: goto return ?
- Next by Date: Re: goto return ?
- Previous by thread: Re: goto return ?
- Next by thread: Re: goto return ?
- Index(es):
Relevant Pages
|
|