if classof( object) do_this(); else do_that(); end; if classof( object).has_method( X ) ....