Re: how to reason about two dimentional array(vector) like...

2009-02-05 Thread wubbie
for simplicity, first tried to create two dimentional array(vector) of numbers. On Feb 5, 1:58 am, Emeka wrote: > Where did 'ref' go in your own implementation? > > Emeka --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: how to reason about two dimentional array(vector) like...

2009-02-04 Thread canadaduane
Wow, thanks wwmorgan! I too was struggling to have some semblance of intuition on the first form, but this one is much easier. Duane On Feb 4, 10:19 pm, wwmorgan wrote: > Here's what I came up with: is it any clearer? > > (def board >   (vec (for [i (range dim)] >             (vec (for [j (ran

Re: how to reason about two dimentional array(vector) like...

2009-02-04 Thread Emeka
Where did 'ref' go in your own implementation? Emeka --~--~-~--~~~---~--~~ 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

Re: how to reason about two dimentional array(vector) like...

2009-02-04 Thread wwmorgan
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 wrote: > Hi, > > Have some difficulties in reasoning about it. > From ants.clj, > (def boar

Re: how to reason about two dimentional array(vector) like...

2009-02-04 Thread wubbie
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,

how to reason about two dimentional array(vector) like...

2009-02-04 Thread wubbie
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 sim