[Web-SIG] a convenient way to deeply nest try/finally statements

Paul Moore p.f.moore at gmail.com
Fri Oct 14 11:05:54 CEST 2005


On 10/14/05, Shannon -jj Behrens <jjinux at gmail.com> wrote:
> I was following the "with" statement thing for a while, but eventually
> gave up on keeping up with the dev mailing list.  Please correct me if
> I'm wrong, but the benefit of my library is also that you don't have
> to nest things inside each other.  I.e. it's a flat list of (init,
> destruct) that is implemented as nested try/finallys but doesn't look
> like that.  Hence, it's easy to construct such lists and rearrange
> them dynamically [or inject things into them from within subclasses].
>
> Am I mistaken?

No, you're right, but I had assumed it would be easy enough to write a
"combined" function which allowed you to transform

    with a:
        with b:
            with c:
                whatever

into

    with combined(a,b,c):
        whatever

Having said that, this is probably just what your library does, but
recast to work with the "with" statement...

Paul.


More information about the Web-SIG mailing list