October 11, 2003
Any reason why we can't borrow some nice parts from a couple of other languages, and allow the following

    Enumerator Enumerate()
    {
        hrecls_t        hSrch;
        recls_rc_t      rc      =   Search_Create(m_searchRoot, m_pattern,
m_flags, hSrch);

        try
        {
            return new Enumerator(hSrch, rc);
        }
        catch
        {
            Search_Close(hSrch);

            throw;
        }
    }


which would translate to

    Enumerator Enumerate()
    {
        hrecls_t        hSrch;
        recls_rc_t      rc      =   Search_Create(m_searchRoot, m_pattern,
m_flags, hSrch);

        try
        {
            return new Enumerator(hSrch, rc);
        }
        catch(Exception x)
        {
            Search_Close(hSrch);

            throw x;
        }
    }

It's a nice sugar.



October 14, 2003
Matthew Wilson wrote:

>Any reason why we can't borrow some nice parts from a couple of other
>languages, and allow the following
>
>    Enumerator Enumerate()
>    {
>        hrecls_t        hSrch;
>        recls_rc_t      rc      =   Search_Create(m_searchRoot, m_pattern,
>m_flags, hSrch);
>
>        try
>        {
>            return new Enumerator(hSrch, rc);
>        }
>        catch
>        {
>            Search_Close(hSrch);
>
>            throw;
>        }
>    }
>
>
>which would translate to
>
>    Enumerator Enumerate()
>    {
>        hrecls_t        hSrch;
>        recls_rc_t      rc      =   Search_Create(m_searchRoot, m_pattern,
>m_flags, hSrch);
>
>        try
>        {
>            return new Enumerator(hSrch, rc);
>        }
>        catch(Exception x)
>        {
>            Search_Close(hSrch);
>
>            throw x;
>        }
>    }
>
>It's a nice sugar.
>
>
>
>  
>
I like it.

-Anderson