User Tools

Site Tools


lecture:nrepl:sources

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lecture:nrepl:sources [2013/03/08 15:31]
psk810
lecture:nrepl:sources [2019/02/04 14:26] (current)
Line 990: Line 990:
                m #{:expects :​requires}))))))                m #{:expects :​requires}))))))
 </​code>​ </​code>​
 +
 +==== dependencies ====
 +
 +<code clojure>
 +(defn- dependencies
 +  [set start dir]
 +  (let [ops (start dir)
 +        deps (set/select
 +               (comp seq (partial set/​intersection ops) :handles)
 +               set)]
 +    (when (deps start)
 +      (throw (IllegalArgumentException.
 +               ​(format "​Middleware %s depends upon itself via %s"
 +                       ​(:​implemented-by start)
 +                       ​dir))))
 +    (concat ops
 +            (mapcat #​(dependencies set % dir) deps))))
 +</​code>​
 +
 +==== comparator ====
 +
 +<code clojure>
 +(defn- comparator
 +  [{a-requires :requires a-expects :expects a-handles :handles}
 +   ​{b-requires :requires b-expects :expects b-handles :handles}]
 +  (or (->> (into {} [[[a-requires b-handles] -1]
 +                     ​[[a-expects b-handles] 1]
 +                     ​[[b-requires a-handles] 1]
 +                     ​[[b-expects a-handles] -1]])
 +        (map (fn [[sets ret]]
 +               (and (seq (apply set/​intersection sets)) ret)))
 +        (some #{-1 1}))
 +      0))
 +</​code>​
 +
 +===== 미들웨어 함수들 =====
 +
 +==== session ====
 +==== add-stdin ====
 +==== wrap-describe ====
 +==== interruptible-eval ====
 +==== wrap-load-file ====
 +==== pr-values ====
 +
lecture/nrepl/sources.1362756717.txt.gz · Last modified: 2019/02/04 14:26 (external edit)