On Mon, Jun 13, 2005 at 12:57:32AM +0200, Chip Salzenberg wrote:
> On Sun, Jun 12, 2005 at 11:26:49PM +0100, Piers Cawley wrote:
> > sub foo { my $x = 1; return sub { eval $^codestring } }
> > say foo()("$x");
>
> I'm pretty sure you meant single-quoted, and you perhaps might maybe
> need
On Sun, Jun 12, 2005 at 11:26:49PM +0100, Piers Cawley wrote:
> sub foo { my $x = 1; return sub { eval $^codestring } }
> say foo()("$x");
I'm pretty sure you meant single-quoted, and you perhaps might maybe
need a dot there:
sub foo { my $x = 1; return sub { eval $^codestring } }
On 6/12/05, Dave Mitchell <[EMAIL PROTECTED]> wrote:
> You may be using slow evals, but other fast code may not be. Should the
> closure in
>
> sub foo { my $x = 1; return sub { 1 } }
>
> also capture the current instance of $x? You are basically condeming any
> code that creates any closure,
On Sun, Jun 12, 2005 at 06:22:22PM -0500, Rod Adams wrote:
> Well, you could always do something like:
>
>sub foo { my $x = 1; return sub {my $x := $OUTER::x; eval $^codestring} }
In perl5, that would just be
sub foo { my $x = 1; return sub { $x ; eval $_[0]} }
--
You live and learn (a
On Sun, Jun 12, 2005 at 11:26:49PM +0100, Piers Cawley wrote:
> Chip and I have been having a discussion. I want to write:
>
> sub foo { my $x = 1; return sub { eval $^codestring } }
> say foo()("$x");
>
> I claim that that should print 1. Chip claims it should throw a warning
> about bec
Piers Cawley wrote:
Chip and I have been having a discussion. I want to write:
sub foo { my $x = 1; return sub { eval $^codestring } }
say foo()("$x");
I claim that that should print 1. Chip claims it should throw a warning about
because of timely destruction. My claim is that a closure
> Piers Cawley said:
> in other words, some way of declaring that a subroutine wants to hang onto
> every lexical it can see in its lexical stack, not matter what static analysis
> may say.
I'm not arguing with the idea, in general. I just want to point out
that this implies that you're going to h
Chip and I have been having a discussion. I want to write:
sub foo { my $x = 1; return sub { eval $^codestring } }
say foo()("$x");
I claim that that should print 1. Chip claims it should throw a warning about
because of timely destruction. My claim is that a closure should close over the
On Wed, Jun 08, 2005 at 12:20:57PM -0700, Larry Wall wrote:
> : I'm not sure how this selection mechanism is meant to be used.
>
> The skip is meant to be applied after filtration. Don't filter out
> things you want to see later, in other words.
Okay, caller done as r4555. Without :label for now