Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'
Sorry but it's a bit off-topic, any one tried running compojure in REPL in clojure eclipse plug-in?? I failed with that while it works in Netbeans plug-in.Any help? Thanks. --~--~-~--~~~---~--~~ 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 - please be patient with your first post. 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 -~--~~~~--~~--~--~---
Using Ref
Hi : I would like to simulate a simple database with the STM of clojure. The rules are 1. There can be many rooms, and each room has its own attirbute 2. One room contains many people, and each person has its own attribute 3. rooms can be created, and deleted, and people can be added into or removed from room. So I made a globle variable *rooms*, where *rooms* is a reference of a sequence of references of rooms, where room is a hashmap, with an attribute of reference of a sequence of references of people. Just like this, (def *rooms* (ref {"room_1" (ref {:players (ref [(ref player)])} ) } ) ) Ouch, it has 4 refs @@ I think it's hard to control, but why did I make that many ref? If there is fewer refs, the functions that alter might need to see outer ref to do an alter. Any one got an idea to make the code easier ?? Thanks --~--~-~--~~~---~--~~ 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 - please be patient with your first post. 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 -~--~~~~--~~--~--~---
Why this macro fails??
user=> (try (Integer/parseInt "x") (catch Exception _ 0)) 0 user=> (defmacro parse-int [a default] `(try (Integer/parseInt ~a) (catch Except ion _ ~default))) #'user/parse-int user=> (parse-int "x" 0) java.lang.Exception: Can't bind qualified name:user/_ (NO_SOURCE_FILE: 0) --~--~-~--~~~---~--~~ 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 - please be patient with your first post. 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 -~--~~~~--~~--~--~---
Memory Problem
Hi : I would like to know why ( from http://stackoverflow.com/questions/749911/how-can-i-leak-memory-in-clojure ) (drop 90 (vec (range 100))) would cause memory problem in clojure and how to fix it? Thanks Because I think my code might have similar problem of memory cannot be released. --~--~-~--~~~---~--~~ 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 - please be patient with your first post. 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 -~--~~~~--~~--~--~---
Re: Memory Problem
Oh I see, Thanks.., but how to I check if a function is lazy or not? --~--~-~--~~~---~--~~ 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 - please be patient with your first post. 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 -~--~~~~--~~--~--~---
Help! Clojuresque build failed
Hi: I am not familiar with gradle, but I cannot build clojuresque, so I cannot build clojureql. The log building clojuresque is as follows : Thanks for any help. D:\tools\clojuresque>gradle build :compileJava :compileGroovy 07:19:24.781 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - [ant:antlib:org.apac he.tools.ant] Could not load definitions from resource org/apache/ tools/ant/antl ib.xml. It could not be found. 07:19:24.796 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - Class org.codehaus.g roovy.ant.Groovyc loaded from parent loader (parentFirst) 07:19:24.796 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - +Datatype groovyc o rg.codehaus.groovy.ant.Groovyc 07:19:24.828 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - fileset: Setup scann er in dir D:\tools\clojuresque\src\main\groovy with patternSet{ includes: [] exc ludes: [] } 07:19:24.843 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - [ant:groovyc] clojur esque\ClojureCompileTask.groovy omitted as D:\tools\clojuresque\build \classes\ma in\clojuresque\ClojureCompileTask.class is up to date. 07:19:24.843 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - [ant:groovyc] clojur esque\ClojurePlugin.groovy omitted as D:\tools\clojuresque\build \classes\main\cl ojuresque\ClojurePlugin.class is up to date. 07:19:24.843 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - [ant:groovyc] clojur esque\ClojurePluginConvention.groovy omitted as D:\tools\clojuresque \build\class es\main\clojuresque\ClojurePluginConvention.class is up to date. 07:19:24.843 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - [ant:groovyc] clojur esque\ClojureSourceSet.groovy omitted as D:\tools\clojuresque\build \classes\main \clojuresque\ClojureSourceSet.class is up to date. 07:19:24.843 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - [ant:groovyc] clojur esque\DefaultClojureSourceSet.groovy omitted as D:\tools\clojuresque \build\class es\main\clojuresque\DefaultClojureSourceSet.class is up to date. 07:19:24.843 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - [ant:groovyc] clojur esque\ClojureCompileTask.groovy skipped - don't know how to handle it 07:19:24.843 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - [ant:groovyc] clojur esque\ClojurePlugin.groovy skipped - don't know how to handle it 07:19:24.843 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - [ant:groovyc] clojur esque\ClojurePluginConvention.groovy skipped - don't know how to handle it 07:19:24.843 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - [ant:groovyc] clojur esque\ClojureSourceSet.groovy skipped - don't know how to handle it 07:19:24.843 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - [ant:groovyc] clojur esque\DefaultClojureSourceSet.groovy skipped - don't know how to handle it :processResources :classes :compileTestJava :compileTestGroovy :processTestResources :testClasses :test BUILD SUCCESSFUL -- 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 - please be patient with your first post. 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
Re: Help! Clojuresque build failed
Thanks for the help. I still cannot build it in Windows, but I just download the ClojureQL 0.9.7 from clojars. -- 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 - please be patient with your first post. 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
STM with deeper structure
Hi : Say, I have a (def *a (ref {:b [{:c 5}]})) . I want to add 1 to the :c inside, how would I write? (Note: the value 5 is in (:b 0 :c), while 0 is the array index) (dosync (alter *a __ )) ; please help me fill the blank. Someone mention I can use the zipper library or the walker library, but after I checked I still have no idea how to make it. Thanks. -- 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 - please be patient with your first post. 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
Need help for the macro with defn and defmacro inside
Hi : I would try to make a macro to simplify the database methods as follows, but it doesn't work, is there any way to fix it, or any easier solution? Thanks.. (defmacro with-db [& body] `(with-connection *db* ~...@body)) (defmacro with-transaction [& body] `(with-db (transaction ~...@body))) ; ; basic table operations - drop, insert, update, select(by id) ; (defmacro create-database-methods [db] (let [db# db] `(do (defn (var (str "drop-" db#)) [] (try (drop-table (keyword ~db#)) (catch Exception _)) (defn (var (str "insert-" db#)) [body] (insert-values (keyword ~db#) (keys body) (vals body))) (defn (var (str "update-" db#)) [id attribute-map] (update-values (keyword ~db#) ["id=?" id] attribute-map)) (defmacro select-userentry [id & body] `(with-transaction with-query-results rs [~~(str "select * from " ~~db# " where id=?") id] ~...@body)) -- 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 - please be patient with your first post. 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
Re: Need help for the macro with defn and defmacro inside
Oh, thanks Meikel, I don't have a strong knowledge of how those symbol, gensym and symbolic quote and unquote work? It's like a puzzle, but I think I know a bit more with your help . -- 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 - please be patient with your first post. 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
Comparing Cycle
Hi : (def a (cycle '(1 2 3 4))) and (= a (drop 4 a)) I suppose it would return true, but it cannot return. -- 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 - please be patient with your first post. 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
Re: (Clojure-related book) Seven Concurrency Models in Seven Weeks
What are those 7 models ? -- -- 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 - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] 美味しいClojure
Is there any E-book to buy ? The shipping cost of Amazon.jp is high. -- -- 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 - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Not sure if it's a bug or not
Hi : In my web project the namespace is jinrou-clojure.army, and the file is at jinrou-clojure/army.clj, most the the classes are compiled to jinrou_clojure directory, but some files with name army$reify__3155.class are compiled into jinrou-clojure/army directory ( note: it's a - , not a _ like most of the files, which I think it should be _ like most of the files ) I am using leiningen with leiningen-war to compile the file though. -- 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 - please be patient with your first post. 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
Slow static file handing with lein ring server
I don't know why, but it seems to have a one second delay getting each static file even in local host testing. :dependencies [[org.clojure/clojure "1.2.1"] [org.clojure/clojure-contrib "1.2.0"] [compojure "0.6.4"] [ring-serve "0.1.0"] [enlive "1.0.0"] [clojureql "1.0.0"] [mysql/mysql-connector-java "5.1.6"]] :dev-dependencies [[lein-ring "0.4.5"]] (defroutes main-routes (route/files "/") (route/not-found "Page not found")) And I even tried route/resources, it's still slow, any idea to make those file cached or any Jetty configuration is needed? Note : I used firefox httpwatch to test, it seems with Http 1.1, after the page is retrieved, it simultaneously retrieve 5 image files each time, but it takes one second only to return the image is not outdated (note : the image is not transfered, just the header). -- 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 - please be patient with your first post. 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
Re: Slow static file handing with lein ring server
Hi : Thanks for the reply. The entire page costs about 5 seconds loading about 40 pictures with each picture about 3K. And when I put the pictures under some static web server (Nginx), the picture loading time is down to 0.4 seconds, while the main page (compojure/ring/enlive) costs still a long 1 second in local host testing. I am not sure it's because of jetty or compojure or ring, but if it's picture it shouldn't be enlive. I would think to move the project to maybe Lift, for the clojure solution seems a bit slow. On 8月2日, 上午3時03分, James Reeves wrote: > On 1 August 2011 08:24, sailormoo...@gmail.com wrote: > > > > > > > I don't know why, but it seems to have a one second delay getting each > > static file even in local host testing. > > > :dependencies [[org.clojure/clojure "1.2.1"] > > [org.clojure/clojure-contrib "1.2.0"] > > [compojure "0.6.4"] > > [ring-serve "0.1.0"] > > [enlive "1.0.0"] > > [clojureql "1.0.0"] > > [mysql/mysql-connector-java "5.1.6"]] > > :dev-dependencies [[lein-ring "0.4.5"]] > > > (defroutes main-routes > > (route/files "/") > > (route/not-found "Page not found")) > > > And I even tried route/resources, it's still slow, any idea to make > > those file cached or any Jetty configuration is needed? > > Are you certain that it's the route/files or route/resources functions > that are slow? > > Have you tried replacing those functions with routes that return strings? > > - James- 隱藏被引用文字 - > > - 顯示被引用文字 - -- 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 - please be patient with your first post. 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
Re: Why is lein so slow?
I found lein repl is slower and most of time it just freezes. -- 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 - please be patient with your first post. 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
comp inside macro
Hi : I would like to create a macro as follows. Note : the prinln function actually is something more sophisticated, but I would like to evaluate the composition of one predefined function and the other from the input argument. And I got some errors, why? Thanks user=> (defmacro asdf [& {:keys [a]}] `(println ~(comp (partial + 1) a))) #'user/asdf user=> (asdf :a (partial * 2)) IllegalArgumentException No matching ctor found for class clojure.core$comp$fn__ 4034 clojure.lang.Reflector.invokeConstructor (Reflector.java:163) -- 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 - please be patient with your first post. 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
Re: comp inside macro
Solved. Thanks ^o^ -- 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 - please be patient with your first post. 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