I am new to Clojure. I am trying to get two copies of the card suit vector. Wrong DRY way I can think of,
(def suits [:clubs :diamonds :hearts :spades]) (def two-times (concat suits suits))
There should be a more functional way (even if it takes more characters :-)). What if I want N times? Any suggestions?
Everything I try, for example
(replicate 2 suits)
leads to two separate vectors:
([:clubs :diamonds :hearts :spades] [:clubs :diamonds :hearts :spades])
How to "smooth" the structure?
clojure sequences playing-cards
Ralph
source share