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)] ..) -- Krešimir Šojat -- You

Re: map not working in loop

2010-03-05 Thread Krešimir Šojat
Hi, On Mar 5, 3:05 pm, Glen Rubin rubing...@gmail.com 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

Re: getting a library listed on the library page?

2010-02-24 Thread Krešimir Šojat
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 clojure@googlegroups.com

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

2010-02-22 Thread Krešimir Šojat
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 group. To post to this group, send email to clojure@googlegroups.com Note that posts from new

Re: macro headaches

2009-12-15 Thread Krešimir Šojat
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 Google Groups Clojure group. To post

Re: Package manager proposal

2009-08-04 Thread Krešimir Šojat
. 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 --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Package manager proposal

2009-08-04 Thread Krešimir Šojat
: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-03 Thread Krešimir Šojat
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, send email

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 received this message because you

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. To post

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 to clojure

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
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 from this group

Re: Contribs with dependencies

2009-04-14 Thread Krešimir Šojat
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: 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 received this message

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

2009-04-05 Thread Krešimir Šojat
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 --~--~-~--~~~---~--~~ You received this message because you

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@googlegroups.com To unsubscribe

Re: Using proxy with new method being added

2009-03-25 Thread Krešimir Šojat
-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 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

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) -- Krešimir Šojat

Re: The Application Context Pattern

2009-03-10 Thread Krešimir Šojat
, 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@googlegroups.com To unsubscribe from this group, send

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: 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 group. To post