Farklı referanslar için bir vektör oluşturmanın en kolay yolu nedir?Referanslar Clojure Vector of
listesini döndürür (repeat 5 (ref nil))
kullanarak, ama hepsi aynı ref referans alır:
user=> (repeat 5 (ref nil))
(#<[email protected]: nil> #<[email protected]: nil> #<[email protected]: nil> #<[email protected]: nil> #<R
[email protected]: nil>)
aynı sonuç (replicate 5 (ref nil))
ile:
user=> (replicate 5 (ref nil))
(#<[email protected]: nil> #<[email protected]: nil> #<[email protected]: nil> #<[email protected]: nil>
#<[email protected]: nil>)
ve sarın (vec (almak 5 (art arda # (ref nil)))) –