0
我有三個載體:連詞到Clojure的矢量,如果矢量大小小於一定量
(def v1 ["one" "two" "three"])
(def v2 ["one" "two" "three" "four"])
(def v3 ["one" "two" "three" "four" "five"])
我需要確保該矢量的大小始終是5個元素。我希望有一個功能,通過每個到會檢查大小和連詞空字符串作爲佔位符當尺寸小於5這樣,我得到:
(def new-v1 ["one" "two" "three" "" ""])
(def new-v2 ["one" "two" "three" "four" ""])
(def new-v3 ["one" "two" "three" "four" "five"])
感謝。
是完美!謝謝 – Zuriar