Slide 54
Slide 54 text
;; we dispatch on type here so we can use function metadata.
(defmulti to-predicate
(fn [op input output]
(type op)))
(defprotocol ICouldFilter
(filter? [this]
"filter? returns true if, given no input or output signifier, the
operation takes inputs by default, false if outputs by
default."))
(defprotocol IPlatform
(generator? [this candidate]
"Returns true if the supplied candidate can become a generator,
false otherwise.")
(generator [this candidate output-fields options]
"Returns a tuple producer, in the world of the implementing
Platform.")
(plan [this query]
"Accepts a Cascalog subquery and compiles it down into some notion
of a plan in the target platform's world."))