are they really equivalent?
Looks like they are but...

Also I was trying to decompose...
user=> (def x (apply vector (map (fn [_] 1) (range 3))))
#'user/x
user=> x
[1 1 1]
user=> (apply vector (map (fn [_] x) (range 3)))
[[1 1 1] [1 1 1] [1 1 1]]

and now it makes a lot more sense...



On Feb 5, 12:19 am, wwmorgan <wmorga...@gmail.com> wrote:
> 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 <sunj...@gmail.com> 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 clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to