rcf
rcf copied to clipboard
idea: richer support for pattern matching Exceptions
Should be able to do something cool with unification, so that this "documentation of proof of bug" is fully semantic
(tests
(p/run2 (p/vars hash-map true?) (! ~#'(when (true? true) :ok)))
% := :ok ; pass
(p/run2 (p/vars hash-map true?) (! ~#'(when (true? ~@ true) :ok)))
% := :ok
;; FAIL
;; java.lang.ClassCastException: class hfdl.impl.runtime.Failure cannot be cast to class clojure.lang.IFn
;; at hfdl.impl.util$bind_flow$fn__50103.invoke(util.cljc:128)
;; at hfdl.impl.switch$transfer_BANG_$fn__50158.invoke(switch.cljc:89)
;; at hfdl.impl.switch$transfer_BANG_.invokeStatic(switch.cljc:89)
;; at hfdl.impl.switch$transfer_BANG_.invoke(switch.cljc:50)
;; at hfdl.impl.switch$switch$fn__50162.invoke(switch.cljc:114)
;; at missionary.impl.Reactor.publish(Reactor.java:390)
)
Consider introducing an operator :! to indicate "this is an expected failure acknowledging a bug, until fixed it should not fail the suite so count it as pass"