Isn't there something like:

        {
                my $s does LEAVE { destroy $s } = new CoolClass;
                # ... do stuff that may throw ...
        }

Or something like that?

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Martin D Kealey
Sent: Thursday, April 28, 2005 11:00 PM
To: perl6-internals@perl.org
Subject: Re: parrot and refcounting semantics


On Thu, 28 Apr 2005, Luke Palmer wrote:
> Or, with the "block hooks" that I keep claiming makes timely
destruction
> almost never needed, it is:
>
>     {
>         my $s = new CoolClass;
>         # ... do stuff that may throw ...
>         LEAVE { destroy $s }
>     }
>
> This destroys properly and even propagates the exception.

That's good ... but can we have a shorthand; stealing an old C keyword,
I'd
suggest:

      {
          auto $a = new CoolClass;
          # ... do stuff that my throw ...
      }


The information contained in this e-mail message is privileged and/or
confidential and is intended only for the use of the individual or entity
named above.  If the reader of this message is not the intended
recipient, or the employee or agent responsible to deliver it to the
intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please immediately
notify us by telephone (330-668-5000), and destroy the original
message.  Thank you.

Reply via email to