1.2.3-SNAPSHOT Arrow_down_16x16
  • (pairs a b)
returns unique pairs of a and b where members of a and b can not be paired with the correspoding slot in the other list.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/stats.clj:2813 top

(defn pairs 
"returns unique pairs of a and b where members of a and b can not be paired with the correspoding slot in the other list."
[a b]
((fn combine [combos ra rb]
    (let [heada (first ra)
          level-combos (for [bx (rest rb)]
                         [heada bx])
          all-combos (concat combos level-combos)]
      (if (= 0 (count (rest ra)))
        all-combos
        (combine all-combos (rest ra) (rest rb))))) [] a b))
Vars in incanter.stats/pairs: = count defn fn let rest
Used in 0 other vars

Comments top

No comments for pairs. Log in to add a comment.