 
 : recover-fail ( try fail -- )
     [ drop call ] [
-        >r nip r> dup fail?
+        [ nip ] dip dup fail?
         [ drop call ] [ nip throw ] if
     ] recover ; inline
 

    in>> [ ndrop f ] curry [ recover-fail ] curry ;

: [matches?] ( quot -- undoes?-quot )
    [undo] dup infer [ true-out ] keep false-recover curry ;

MACRO: matches? ( quot -- ? ) [matches?] ;

TUPLE: no-match ;
: no-match ( -- * ) \ no-match new throw ;
M: no-match summary drop "Fall through in switch" ;

: recover-chain ( seq -- quot )

RENAME: _ fry => __
IN: inverse

ERROR: fail ;
M: fail summary drop "Unification failed" ;

: assure ( ? -- ) [ fail ] unless ;

: =/fail ( obj1 obj2 -- ) = assure ;

! Inverse of a quotation

