Skip to content

Instantly share code, notes, and snippets.

Created October 25, 2011 19:03
Show Gist options
  • Save anonymous/1313861 to your computer and use it in GitHub Desktop.
Save anonymous/1313861 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Oct 25, 2011.
    9 changes: 9 additions & 0 deletions fronx-4clojure-solution84.clj
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    ;; fronx's solution to Transitive Closure
    ;; https://4clojure.com/problem/84

    (fn [rel]
    (let [trans (set
    (for [[a b] rel [c d] rel]
    [a (if (= b c) d b)]))
    done (= trans rel)]
    (if done trans (recur trans))))