Hi,
sub foo (Code $code) {
my $return_to_caller = -> $ret { return $ret };
$code($return_to_caller);
return 23;
}
sub bar (Code $return) { $return(42) }
say foo &bar; # 42 or 23?
I think it should output 42, as the return() in the pointy
block $return_to_caller affects &foo, not the pointy block.
To leave a pointy block, one would have to use leave(), right?
--Ingo
--
Linux, the choice of a GNU | To understand recursion, you must first
generation on a dual AMD | understand recursion.
Athlon! | - return() in pointy blocks Ingo Blechschmidt
- Re: return() in pointy blocks Matt Fowles
- Re: return() in pointy blocks Ingo Blechschmidt
- Re: return() in pointy blocks Luke Palmer
- Re: return() in pointy blocks Luke Palmer
- Re: return() in pointy blocks Matt Fowles
- Re: return() in pointy blocks TSa (Thomas Sandlaß)
- Re: return() in pointy blocks TSa (Thomas Sandlaß)
- Re: return() in pointy blocks Larry Wall
- Re: return() in pointy blo... TSa (Thomas Sandlaß)
- Re: return() in pointy... Larry Wall
