# Efficiency of try..endtry

Colin McCormick (colin@tripod.tripod.com)
Thu, 29 Aug 1996 11:28:39 PDT

- Messages sorted by:[ date ][ thread ][ subject ][ author ]

    Can anyone give me an idea of which of these code segments will be more
    efficient to try to call a verb that I do not know exists?

    [A] ...
        try
          #2:blah(foo);
        except (E_VERBNF)
          #2:notfound();
        endtry
        ...

    [B] ...
        if (blah in verbs(#2))
          #2:blah(foo);
        else
          #2:notfound();
        endif
        ...

    I understand that [B] won't succeed if "blah" is defined on an ancestor
    of #2, but I'm not worried about that at the moment.

    Thanks. :)

    Colin

    Colin McCormick
    Tripod, Inc.
    http://www.tripod.com