develooper Front page | perl.perl6.language | Postings from August 2001

Re: explicitly declare closures???

Thread Previous | Thread Next
Dave Mitchell
August 22, 2001 03:48
Re: explicitly declare closures???
Message ID:
Paul Johnson <> wrote:
> Try changing your original example from
>   sub foo {
> to
>   *foo = sub {
> and you'll see that everything works "as expected".

add a BEGIN so that instantion happens at the same time that a named
sub would be:

BEGIN { * foo = sub { ....} }

and the problem comes back ;-)

Anyway, coming back to my original suggestion:

I think closures are a lot harder (or at least subtler) than people
think, and explicit declarations might help. There again, they might not.

Ah well....

Dave M.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About