Anonymous user
Permutations: Difference between revisions
→{{header|Clojure}}: Leave the library function. It is important to also show what is available in standard libraries if allowed by the task description.
m (→{{header|Python}}: Add sub-heading.) |
(→{{header|Clojure}}: Leave the library function. It is important to also show what is available in standard libraries if allowed by the task description.) |
||
Line 1,024:
=={{header|Clojure}}==
===Library function===
In an REPL:
<lang clojure>
user=> (require 'clojure.contrib.combinatorics)
nil
user=> (clojure.contrib.combinatorics/permutations [1 2 3])
((1 2 3) (1 3 2) (2 1 3) (2 3 1) (3 1 2) (3 2 1))<lang>
===Explicit===
Replacing the call to the combinatorics library function by its real implementation.
<lang clojure>
(defn- iter-perm [v]
|