expand question

2010-11-14 Thread garf
(map vector [1 2 3] [4 5 6] [7 8 9]) gives back ([1 4 7] [2 5 8] [3 6 9]) but if I have a function that returns the list: '([1 2 3] [4 5 6] [7 8 9]) and call map vector with the list, then I no longer get ([1 4 7] [2 5 8] [3 6 9]) i.e. (def x '([1 2 3] [4 5 6] [7 8 9])) (map vector x) ==

Re: Newbie question on defstructs

2010-11-13 Thread garf
h the positional constructors of records > a bit less awkward. > > Here's some links:http://clojure.org/datatypeshttp://clojure.org/protocols > > Hope that helps, > Chris > > On Sat, Nov 13, 2010 at 11:48 AM, Michel Alexandre Salim > > > > > > > > wr

Re: Newbie question on defstructs

2010-11-13 Thread garf
further advice On Nov 13, 10:48 am, Michel Alexandre Salim wrote: > On Sat, 13 Nov 2010 06:31:03 -0800, garf wrote: > > If I have a struct whose creation will require some function calls that > > references some of its members, I am unsure how to go about it in a > > clea

Re: Newbie question on defstructs

2010-11-13 Thread garf
b)] >            (struct tz a b c))) > > On Nov 13, 7:31 am, garf wrote: > > > > > > > > > If I have a struct whose creation will require some function calls > > that references some of its members, I am unsure how to go about it in > > a clean way.  F

Newbie question on defstructs

2010-11-13 Thread garf
If I have a struct whose creation will require some function calls that references some of its members, I am unsure how to go about it in a clean way. For example: (defstruct tz :a :b :c) (def tz1 1 2 (+ (:a tz1) (:b tz1)) will not work, but reflects the problem. Ideally at the end of this

Re: defrecord issue in unit tests

2010-08-31 Thread garf
--Doh! Thanks, David, that worked On Aug 30, 8:29 am, David Nolen wrote: > On Mon, Aug 30, 2010 at 6:37 AM, garf wrote: > > I am getting the following error when I switched from defstruct to > > defrecord > > **Unable to resolve classname: Rule-record (RecordInitTest.clj

defrecord issue in unit tests

2010-08-30 Thread garf
I am getting the following error when I switched from defstruct to defrecord **Unable to resolve classname: Rule-record (RecordInitTest.clj:8)** I only have this problem when definition & usage is split between two files, i.e. let first file contain: (ns RecordInitQuest) (defrecord Rule-record

Re: Eclipse Clojure REPL dies (newbie)

2010-08-10 Thread garf
thanks for the answer. I suspect that the REPL dieing is justified, as I tend to use the file as workspace with somethings uncompleted, and with my newness to Clojure in general, I am often doing things in ways that are not correct On Aug 10, 8:21 am, Laurent PETIT wrote: > 2010/8/10 g

Eclipse Clojure REPL dies (newbie)

2010-08-10 Thread garf
On occasion the REPL in Eclipse will stop taking input, or will fail to recognize a function I have just defined. Is there a simple way to get the REPL to restart, or break out of its current state? One other question as well, to get the REPL running when I first bring up Eclipse I have a file th