Skip to content

Instantly share code, notes, and snippets.

@jordanlewis
Created March 3, 2013 22:27
Show Gist options
  • Save jordanlewis/5078618 to your computer and use it in GitHub Desktop.
Save jordanlewis/5078618 to your computer and use it in GitHub Desktop.
(defn combinations [options n]
(let [syms (into [] (repeatedly n gensym))
for-bindings (into [] (interleave syms (repeat options)))]
(eval `(for ~for-bindings ~syms))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment