Created
November 29, 2009 02:51
-
-
Save ato/244769 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn map-structure [xs [y & ys]] | |
(lazy-seq | |
(when y | |
(let [[head tail] (split-at (count y) xs)] | |
(cons head | |
(map-structure tail ys)))))) | |
(map-structure [1 2 3 4] [[0] [1 1 1]]) | |
;; => ((1) (2 3 4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment