So, I must ask, what does this do:
sub foo() {
return my $self = {
print "Block";
return $self;
}
}
my $block = foo;
print "Main";
$block();
print "End";
That is, the block returns from a function that's not currently
executing.
So, I must ask, what does this do:
>sub foo() {
>return my $self = {
>print "Block";
>return $self;
>}
>}
>my $block = foo;
# = sub {print "Block"; return $self;}
A6:
One obvious difference is that the sub on closures is now op
Stefan Lidman writes:
> So, I must ask, what does this do:
>
> >sub foo() {
> >return my $self = {
> >print "Block";
> >return $self;
> >}
> >}
>
> >my $block = foo;
> # = sub {print "Block"; return $self;}
>
> A6:
> One obviou
On Thu, Oct 02, 2003 at 04:15:06AM -0600, Luke Palmer wrote:
> And to clarify:
>
> sub indexof(Selector $which, [EMAIL PROTECTED]) {
> for zip(@data, 0...) -> $_, $index {
> when $which { return $index }
> }
> }
>
> Which actually creates a closure (well, in th
On Thu, Oct 02, 2003 at 11:39:20AM +0100, Dave Mitchell wrote:
> On Thu, Oct 02, 2003 at 04:15:06AM -0600, Luke Palmer wrote:
> > So the question is: What happens when indexof isn't on the call chain,
> > but that inner closure is?
>
> But how can the inner closure be called if not via indexof?
Jonathan Scott Duff wrote:
On Thu, Oct 02, 2003 at 11:39:20AM +0100, Dave Mitchell wrote:
On Thu, Oct 02, 2003 at 04:15:06AM -0600, Luke Palmer wrote:
So the question is: What happens when indexof isn't on the call chain,
but that inner closure is?
But how can the inner closure be called if not
> -Original Message-
> From: Jonathan Scott Duff [mailto:[EMAIL PROTECTED]
> On Thu, Oct 02, 2003 at 11:39:20AM +0100, Dave Mitchell wrote:
> > On Thu, Oct 02, 2003 at 04:15:06AM -0600, Luke Palmer wrote:
> > > So the question is: What happens when indexof isn't on the call chain,
> > > but
Speaking to the practical side, I have written code that has to
disentangle
itself from the failure of a complex startup sequence. I'd love to be
able
to build a dynamic exit sequence. (In fact, being able to do &block
.=
{ more_stuff(); }; is way up on my list...)
I've wanted to do that sort of
Jeff Clites writes:
> >Speaking to the practical side, I have written code that has to
> >disentangle
> >itself from the failure of a complex startup sequence. I'd love to be
> >able
> >to build a dynamic exit sequence. (In fact, being able to do &block
> >.=
> >{ more_stuff(); }; is way up on m
> -Original Message-
> From: Luke Palmer [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 02, 2003 10:23 PM
> To: Jeff Clites
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: The Block Returns
>
>
> Jeff Clites writes:
> > >Speaking to the practical side, I have written code
Austin Hastings writes:
> > -Original Message-
> > From: Luke Palmer [mailto:[EMAIL PROTECTED]
> >
> > But this is already supported, in its most powerful form:
> >
> > wrap &block: { call; other_stuff() }
>
> Hmm, no.
>
> That does a call, which presumes a return, which burns up
> w
11 matches
Mail list logo