Skip to content

Instantly share code, notes, and snippets.

@Sophia-Gold
Created August 23, 2017 05:51
Show Gist options
  • Select an option

  • Save Sophia-Gold/b3428f2a03574488e7b78fc78b67b9c8 to your computer and use it in GitHub Desktop.

Select an option

Save Sophia-Gold/b3428f2a03574488e7b78fc78b67b9c8 to your computer and use it in GitHub Desktop.
(defn map-longest [f default & colls]
(lazy-seq
(when (some seq colls)
(cons
(apply f (map #(if (seq %) (first %) default) colls))
(apply map-longest f default (map rest colls))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment