Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn merge-chains
- [chain1 chain2 & more]
- (let [merge-two-chains (fn [ch1 ch2]
- (let [to-insert (chain->pairs ch2)
- insertions (for [pair to-insert]
- `(insert-pair ~pair))]
- (apply doto ch1 insertions)))]
- (reduce merge-two-chains (apply list chain1 chain2 more))))
Advertisement
Add Comment
Please, Sign In to add comment