develooper Front page | perl.perl6.internals | Postings from April 2005

Re: parrot and refcounting semantics

Thread Previous | Thread Next
From:
Robin Redeker
Date:
April 28, 2005 13:01
Subject:
Re: parrot and refcounting semantics
Message ID:
20050428172449.GA3233@elmex
I just wanted to correct my small example:

On Thu, Apr 28, 2005 at 05:00:53PM +0200, Robin Redeker wrote:
> > Robin Redeker writes:
> And with explicit resource handling (without timely destruction) it may be:
> 
>    {
>      my $s = new CoolClass;
>      ...
>      destroy $s;
>    }

This should actually be, to prevent the resource from leaking:

    {
      my $s = new CoolClass;
      eval {
        ... do stuff that may throws ...
      };
      destroy $s;
    }

> 
> Not that big difference. And this is what we have with
> refcounting/timely destruction:
> 
>    {
>      my $s  = new CoolClass;
>      ...
>    }
> 

The latter example will destruct nicely if something throws.

--
elmex@x-paste.de / robin@nethype.de
Robin Redeker

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About