Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Control flow variables
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dan Sugalski  
View profile  
 More options Nov 18 2003, 11:49 am
Newsgroups: perl.perl6.language
From: d...@sidhe.org (Dan Sugalski)
Date: Tue, 18 Nov 2003 11:14:54 -0500 (EST)
Local: Tues, Nov 18 2003 11:14 am
Subject: Re: Control flow variables

On Tue, 18 Nov 2003, Simon Cozens wrote:
> Austin_Hasti...@Yahoo.com (Austin Hastings) writes:
> > This is what I was talking about when I mentioned being able to do:
> >   &cleanup .= { push @moves: [$i, $j]; }

> This reminds me of something I thought the other day might be useful:

>     $cleanup = bless {}, class {
>         method DESTROY { ... }
>     };

> Of course, it probably wouldn't work in this context because you couldn't
> guarantee that the destructor will be called at the point of loop exit, but I
> like the anonymous class syntax anyway.

     $cleanup = bless {}, class : impatient {
         method DESTROY { ... }
     };

That'll probably do it, at the expense of extra runtime block exit
overhead until the object dies. If you just want a block exit action,
then:

 add_block_exit_action(\&foo);

or something similar will do it. (Though we could add new syntax for it if
you really want... :-)

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
d...@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.