Clojure Vector of Refs -
What is the easiest way to create a vector of different refs? Using
will (repeat 5 (referrals))
return a list, but they will all refer to the same referee:
user = & Gt; (Repeat 5 (ref zero)) (# & lt; ref @ 16ef71: zero> # & lt; referee @ 16ef71: zero> # & lt; ref @ 16ef71: zero & gt; # & lt; ref @ 16ef71: with zero & gt; # & lt; rfe @ 16ef71: zero & gt;)
with (repeat 5 (referee zero))
one Results only:
User = & gt; (Repeat 5 (referee zero)) (# & lt; ref @ 1d88db7: zero & gt; # & lt; ref @ 1d88db7: zero & gt; # & lt; referee @ 1d88db7: zero & gt; # & lt; ref @ 1d88db7: Zero & gt; # & lt; ref @ 1d88db7: Zero & gt;)
User & gt; (Repeated Doctor) ------------------------- Closer.core / Frequently ([F]) Probably no arguments with side effects Does not take the function of, and gives an infinite lazy sequence to its infinite call; (Take 5 (repeated # (not equal to reference)) (# & lt; ref @ 1f10a67: zero & gt; # & lt; ref @ 1e2161d: zero & gt; # ref: @ 1a034d: zero >
Comments
Post a Comment