diff options
author | Jeffrey Straszheim <straszheimjeffrey@gmail.com> | 2009-04-04 00:53:41 +0000 |
---|---|---|
committer | Jeffrey Straszheim <straszheimjeffrey@gmail.com> | 2009-04-04 00:53:41 +0000 |
commit | 09e6d962b3adccfc907589b0ba9ce12801de7bbf (patch) | |
tree | fc2a3de5d74531041c03766489d45cd31f9458a9 /src | |
parent | eaeb3c8450a8c5f185869a0ec8e83f157c61d995 (diff) |
added source-cell? predicate
Diffstat (limited to 'src')
-rw-r--r-- | src/clojure/contrib/dataflow.clj | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/clojure/contrib/dataflow.clj b/src/clojure/contrib/dataflow.clj index eed0bad2..a87ef357 100644 --- a/src/clojure/contrib/dataflow.clj +++ b/src/clojure/contrib/dataflow.clj @@ -97,11 +97,16 @@ (> (count cells) 1) (throwf Exception "Cell %s has multiple instances" name) :otherwise (throwf Exception "Cell %s is undefined" name)))) +(defn source-cell? + "Is this cell a source cell?" + [cell] + (isa? (:cell-type cell) ::source-cell)) + (defn get-source-cells "Returns a collection of source cells from the dataflow" [df] (for [cell (:cells @df) - :when (isa? (:cell-type cell) ::source-cell)] + :when (source-cell? cell)] cell)) (defn get-value |