Here's what I came up with: is it any clearer?
(def board
(vec (for [i (range dim)]
(vec (for [j (range dim)]
(ref (struct cell white)))))))
On Feb 4, 11:30 pm, wubbie <[email protected]> wrote:
> Hi,
>
> Have some difficulties in reasoning about it.
> From ants.clj,
> (def board
> (apply vector
> (map (fn [_]
> (apply vector
> (map (fn [_] (ref (struct cell white)))
> (range dim))))
> (range dim))))
>
> Is there any simpler two dimentional array construct which would be
> easiler to grasp?
>
> thanks,
> -sun
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---