bug: clojure.walk removes all the metadata

2010-06-22 Thread Krešimir Šojat
) nil user=> (meta (:a (w/prewalk identity data))) nil -- Krešimir Šojat -- 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 Note that posts from new members are moderated - plea

Re: 1.2 letfn/reduce bug?

2010-06-11 Thread Krešimir Šojat
Hi, > (defn foo [] >         (letfn (bar [acc val] >                acc) >           (reduce bar {} (range 1 10 > > doesn't compile > java.lang.IllegalArgumentException: Don't know how to create ISeq > from: clojure.lang.Symbol Try (letfn [(bar [acc val] acc

Re: Jersey REST with Clojure is it possible?

2010-04-12 Thread Krešimir Šojat
se it though? > > Thank you As JAX-RS requires use of annotations, you will need to create part of the code in plain Java. After that you can use standard gen-class/ proxy macros for the rest of your application. -- Krešimir Šojat -- You received this message because you are subscribed to

Re: map not working in loop

2010-03-05 Thread Krešimir Šojat
Hi, On Mar 5, 3:05 pm, Glen Rubin wrote: > The following code does not work, when using (range 1 5) as coll > input: Remove the extra () around the coll in (rest (coll)) expression. -- Krešimir Šojat -- You received this message because you are subscribed to the Google Groups "Clo

Re: getting a library listed on the library page?

2010-02-24 Thread Krešimir Šojat
how to get listed are at: http://groups.google.com/group/clojure/browse_thread/thread/affb08d66c048c7f/77f10a8a9a55d089#77f10a8a9a55d089 -- Krešimir Šojat -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Re: How to efficiently import large array of doubles from file?

2010-02-22 Thread Krešimir Šojat
f c) (time (write-data 6000 "dump.txt")) (def d (time (read-data "dump.txt"))) On my machine this version needs ~800mb to load 6000 doubles. -- Krešimir Šojat -- You received this message because you are subscribed to the Google Groups "Clojure" gro

Re: macro headaches

2009-12-15 Thread Krešimir Šojat
e to know if there is a way i could get the macro > i wanted going. Macro will not work in this situation, but you can write it as: (let [obj (MutatingJavaObject.)] (doseq [item list-items] (.add obj item))) -- Krešimir Šojat -- You received this message because you are subscribed to the

Re: Package manager proposal

2009-08-04 Thread Krešimir Šojat
commons- cli:commons-cli:1.3 while ivy roundup repository in org.apache.commons:commons-cli:1.3, there is a namespace mechanism that you can use to rename artifacts. This way there is no need for central naming body and repositories can realy be distributed. -- Krešimir Šojat --~--~-~--~

Re: Package manager proposal

2009-08-04 Thread Krešimir Šojat
what amounts to a distributed repository. There is no centralized repository with Ivy. You can build one, but with Packager resolver every project can create its own repository, it can even keep it in /repo dir in its git/hg/svn tree. -- Krešimir Šojat --~--~-~--~~~---

Re: Package manager proposal

2009-08-03 Thread Krešimir Šojat
esing is that serve there package repository straight from there svn repository so history is tracked. -- Krešimir Šojat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: How to shorten clojure.lang.* classes

2009-06-28 Thread Krešimir Šojat
that is, is there a method to refer to > clojure.lang.APersistentList as APersistentList? I've tried (use > 'clojure.lang) and (require ['clojure.lang :as 'c]), but neither seem > to work. -- Krešimir Šojat --~--~-~--~~~---~--~~ You receiv

Re: Small question: Best way to create a map with vector vals

2009-06-23 Thread Krešimir Šojat
Hi, Try: (def x [[:a 1] [:b 3] [:b 5] [:c 1]]) (into {} (map (fn [[k v]] [k [v]]) a)) Returns: {:c [1], :b [5], :a [1]} -- Krešimir Šojat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: Small question: Best way to create a map with vector vals

2009-06-23 Thread Krešimir Šojat
Sorry about that, didn't see that :b should concat it's vals: (def x [[:a 1] [:b 3] [:b 5] [:c 1]]) (reduce (fn [x [k v]] (assoc x k (if (contains? x k) (conj (x k) v) [v]))) {} x) Returns: {:c [1], :b [3 5], :a [1]} -- Krešimir Šojat --~--~-~--~~~---~--

Re: How difficult would creating a collaborative multi-user online virtual world application be in Clojure?

2009-06-11 Thread Krešimir Šojat
Hi, Take a look at project Wonderland -- https://lg3d-wonderland.dev.java.net/ -- Krešimir Šojat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Dropping strings.

2009-04-30 Thread Krešimir Šojat
> Hum... that's not my experience, I'm at my job right now so I can't > double check this. Looking at the javadoc, it appears that if n is > larger than the string length it will throw an > IndexOutOfBoundsException. That must have been the reason why I've > written drop-str in the first place.

Re: Contribs with dependencies

2009-04-14 Thread Krešimir Šojat
m one task/target script with others. If you can't solve this with normal Ant construct you can drop down to Java and create new Task, or even in Clojure (you will need to initialize your antlib with classpath set to point to clojure.jar). -- Krešimir Šojat --~--~-~--~~---

Re: Contribs with dependencies

2009-04-14 Thread Krešimir Šojat
also check out scriptdef and presetdef tasks. -- Krešimir Šojat --~--~-~--~~~---~--~~ 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

Re: reading properties file: does this helper already exist?

2009-04-08 Thread Krešimir Šojat
> Can't you just write: > (.load (Properties.) (FileInputStream. f)) > and skip separate function altogehter? Err.. that should be: (doto (Properties.) (.load (FileInputStream. f))) .. point remains. -- Krešimir Šojat --~--~-~--~~~---~--~~ You

Re: reading properties file: does this helper already exist?

2009-04-08 Thread Krešimir Šojat
>  If not   > I will add it to java-utils. > Can't you just write: (.load (Properties.) (FileInputStream. f)) and skip separate function altogehter? -- Krešimir Šojat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: ant + ivy IMO is not simpler than POMs (was: ant + ivy)

2009-04-05 Thread Krešimir Šojat
library, it is easy to use it even if jar is not in external repository, url resolver can just download it from web, or packager resolver can extract jars from other archive types like zip files located on external server, custom resolver are also supported. -- Krešimir Šojat --~--~-~--~

Re: Fresh Clojure Tutorial

2009-03-29 Thread Krešimir Šojat
Is link broken? blogpost return pagen not found message. -- Krešimir Šojat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegro

Re: Using proxy with new method being added

2009-03-25 Thread Krešimir Šojat
ar (proxy [IFoo] (foo [n] (* 3 n Or you can use gen-class instead of gen-interface and implement Foo as concrete class. Proxy will accept any method name you give him, but it will expose only methods in class and interfaces it extends. -- Krešimir Šojat --~--~-~--~~~---

Re: Trying to get a list of random numbers using repeat

2009-03-23 Thread Krešimir Šojat
> user=> (repeat 10 (rand-int 49)) > (4 4 4 4 4 4 4 4 4 4) Hi, (rand-int 49) will produce one integer, and repeat will repeat it 10 times, that is why you see same number repeated. To fix this use: user=> (take 10 (repeatedly #(rand-int 49))) (21 29 9 20 15 34 8 28 16 26) -- Kr

Re: The Application Context Pattern

2009-03-10 Thread Krešimir Šojat
is more a feature preview for now, not something you would use just yet. -- Krešimir Šojat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goo

Re: Clojure documentation for offline use?

2009-02-18 Thread Krešimir Šojat
If you want offline version of clojure.org: hg clone https://bitbucket.org/ksojat/truba/ cd truba ant clojure-org-download (requires wget) When finished, it will place it in dist/clojure.org directory. Or you can just copy wget command from clojure-org-download target. -- Krešimir Šojat

Re: cljc?

2009-02-15 Thread Krešimir Šojat
h' and 'classpathref' attributes like javac and will try to find all .clj files that have (ns ..) in theme, so it can avoid compilation of files that are imported with load directive. Note: It will add srcdir and destdir to classpath for you. -- Krešimir Šojat --~--~-~--~~

Re: Curious about Cells

2009-02-10 Thread Krešimir Šojat
> this errors on loading. Should that be "add-watch" instead? In revision 1194 add-watch was renamed to add-watcher. -- Krešimir Šojat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure&

Re: Curious about Cells

2009-02-10 Thread Krešimir Šojat
values, but if you wish you can set cell's value with: (assoc (.state cell) :value new-value) If you need something more deterministic, you could change update-cell function in first implementation by Stuart so it updates all dependencies in one dosync block. -- Krešimir Šojat --~--~-~--