Re: Problems with Kevin O'Neills Clojure GitHub Mirror
Awesome!! Thanks a bunch! R. 2009/5/7 Kevin O'Neill : > > Branches and tags are now being mirrored. > > -k. > > On Thu, May 7, 2009 at 1:41 PM, Kevin O'Neill wrote: >> I'll look into it. I mirror branches for other projects and i'm sure >> this will be fairly straight forward. >> >> -k. >> >> On Tue, May 5, 2009 at 9:05 PM, Rick Moynihan >> wrote: >>> >>> Yesterday I noticed that the github mirror I'd been using at: >>> >>> http://github.com/kevinoneill/clojure/tree/master >>> >>> Does not appear to be fully mirroring clojure's SVN repository, as it >>> only appears to mirror the trunk. >>> >>> This means that the branches and more importantly the 1.0 tag are not >>> being mirrored. >>> >>> I took a look at this and have managed to knock together a new git >>> repository along with a rough and ready bash script that does the job of >>> mirroring clojures SVN repo. >>> >>> Unfortunately the commit SHA's in my repo are all currently incompatible >>> with Kevin's repository (probably due to him using svn's https and me >>> using http). >>> >>> I'm not convinced I've removed all of the kinks from the script, but it >>> seems to be working, though I'd like to iron out any remaining kinks. >>> The script as it stands with some brief instructions on it's use can be >>> found here: >>> >>> http://sourcesmouth.co.uk/paste/svn-mirror.sh.html >>> >>> Kevin, it'd be great if we could get your repository mirroring >>> everything, this script might help. Though I'm happy also to cron my >>> script from work and have it mirror to github, I'd personally rather >>> just have one clojure git mirror. >>> >>> Let me know if there are any problems/fixes for the above script and how >>> we as a community should proceed to offer a complete git mirror of the >>> svn repo. >>> >>> R. >>> >>> >>> >> >>> >> >> >> >> -- >> email: ke...@oneill.id.au >> web: http://kevin.oneill.id.au/ >> >> If you don't test then your code is only a collection of bugs which >> apparently behave like a working program. >> > > > > -- > email: ke...@oneill.id.au > web: http://kevin.oneill.id.au/ > > If you don't test then your code is only a collection of bugs which > apparently behave like a working program. > > > > -- Rick Moynihan rick.moyni...@gmail.com http://sourcesmouth.co.uk/ --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
Laurent PETIT writes: > I also think it makes sense to deposit the whole "battery" : > clojureXX.jar > clojure-slimXX.jar OK, I would bundle clojure-slim.jar too. I'm not familiar with it, though curious. Would you enlighten me by throwing some light on it's purpose? > clojure-sourcesXX.jar Will be bundled. -Stefan --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
2009/5/7 Stefan Hübner : > > Laurent PETIT writes: > >> I also think it makes sense to deposit the whole "battery" : >> clojureXX.jar >> clojure-slimXX.jar > > OK, I would bundle clojure-slim.jar too. I'm not familiar with it, though > curious. Would you enlighten me by throwing some light on it's purpose? clojure is divided into clojure files (in folder src/clj/ ) and java files (in folder src/jvm/ ) clojure-slimXX.jar contains compiled java files from src/jvm/ + clj files from src/clj/ clojureXX.jar contains compiled java files from src/jvm/ + clj files from src/clj/ + compiled into java classes cjl files from src/clj/ clojureXX.jar has a better startup time since clj files are already compiled into bytecode into classes files (via AOT - Ahead Of Time - clojure files compilation) clojure-slimXX.jar is much smaller than clojureXX.jar. And the clj files will be compiled into bytecode in memory "Just in Time" Certainly both serve different needs for different people. Regards, -- Laurent > >> clojure-sourcesXX.jar > > Will be bundled. > > -Stefan > > > > > --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Got a Clojure library?
On May 5, 2009, at 2:11, liebke wrote: > Name: Incanter > URL: http://github.com/liebke/incanter/tree/master > Author: David Edgar Liebke > Tags: statistics, numerical computing, plotting > License: EPL > Dependencies: Parallel Colt, JFreeChart, OpenCSV > Description: > Incanter is a collection statistical computing and plotting > libraries with R-like semantics. It is also one of the most useful Clojure libraries that I found until now. Thanks a lot! I can finally start to consider using Clojure for work seriously. Konrad. --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
clojure.contrib.test-is/run-tests throws Wrong number of args passed to: test-is$report
Hi everyone, I've upgrade to the lastest release, i'm trying under Emacs to run- tests and now I receive the following error: We evaluating: (run-tests 'konato.ode.tests.test-ode) I receive: java.lang.RuntimeException: java.lang.IllegalArgumentException: Wrong number of args passed to: test-is$report (NO_SOURCE_FILE:0) [Thrown class clojure.lang.Compiler$CompilerException] I did remove all the src repertories and did a complete rebuild of clojure. Tried with clojure 1.0.0 got the same thing. This seems related to emacs slime or a way clojure handle repertory reference , I can still run my test into a clojure repl started in the shell. Another little change, that might be related: Before in emacs I was able to evaluate correctly: (load-file "prjode/src/konato/ode/tests/test_ode.clj") Now, I have to add the full path: (load-file "/home/stephane/prjode/src/konato/ode/tests/test_ode.clj") Here is my clojure starting script: #!/bin/sh -e JAVA=java CLJ_DIR=$HOME/src/clojure CLOJURE=$CLJ_DIR/clojure.jar CONTRIB=$HOME/src/clojure-contrib/clojure-contrib.jar #JLINE=$HOME/src/jline-0.9.94/jline-0.9.94.jar ODE=$HOME/prjode/src/ #CP=$PWD:$CLOJURE:$JLINE:$CONTRIB:$ODE: CP=$PWD:$CLOJURE:$CONTRIB:$ODE:. java -server \ -Xdebug - Xrunjdwp:transport=dt_socket,server=y,suspend=n,address= \ -cp $CP clojure.lang.Repl Thank you, Stephane --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Writer turned programmer seeks string processing advice
Thanks, everybody. The buzz at Hacker News is that the Clojure community is awesome, and the buzz is right. Now, to me, it follows from the advice you gave that I should do two projects: 1. Learn Clojure by implementing (some of) AIML (about half of the language is of no interest to me) 2. Implement what I prototyped in AIML (context, objects, processes) in Clojure Does this sound right? Dirk Luke VanderHart schrieb: > On May 6, 4:39 am, dhs827 wrote: > > I realize now that there is no quick fix, and I'll have to learn a > > lot to do this properly. But are there already enough resources so > > that I can learn how to do it in Clojure? For example, would there be > > enough about string processing in "Programming Clojure" to learn it > > from theere? > > Clojure itself is very well documented for a language that's been out > for less than two years, and as you can see, there is an active > community to turn to for help. With persistence, it's very possible to > become a Clojure expert in a short amount of time. I don't imagine > you'll have any problem with the language itself. > > You'll probably have to get some books or look elsewhere for help with > the actual algorithms specific to this problem domain, though - I > doubt there's any Clojure tutorials dedicated specifically to pattern > matching or AI. But anything that can be implemented in another > language can be implemented (probably better) in Clojure, so if you > know Clojure and you can at least read the examples in the AI > literature, you should be good to go. > > -Luke --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
OK, I've got it. Thanks, Laurent! I would bundle clojure-slim.jar as a "classified" clojure, like Maven calls it. So the final filename would be "clojure-lang-1.0.0-slim.jar". To use this one instead of clojure-lang-1.0.0.jar, the following dependency needs to be declared: org.clojure clojure-lang 1.0.0 slim -Stefan Laurent PETIT writes: > 2009/5/7 Stefan Hübner : >> >> Laurent PETIT writes: >> >>> I also think it makes sense to deposit the whole "battery" : >>> clojureXX.jar >>> clojure-slimXX.jar >> >> OK, I would bundle clojure-slim.jar too. I'm not familiar with it, though >> curious. Would you enlighten me by throwing some light on it's purpose? > > clojure is divided into clojure files (in folder src/clj/ ) and java > files (in folder src/jvm/ ) > > clojure-slimXX.jar contains compiled java files from src/jvm/ + clj > files from src/clj/ > clojureXX.jar contains compiled java files from src/jvm/ + clj files > from src/clj/ + compiled into java classes cjl files from src/clj/ > > clojureXX.jar has a better startup time since clj files are already > compiled into bytecode into classes files (via AOT - Ahead Of Time - > clojure files compilation) > clojure-slimXX.jar is much smaller than clojureXX.jar. And the clj > files will be compiled into bytecode in memory "Just in Time" > > Certainly both serve different needs for different people. > Regards, --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
Seems fine to me. One question, though: I see that you want to name the artifact "clojure-lang" and not just "clojure". Why not just "clojure" as is the case for the ant build script ? I guess this could just confuse people ? 2009/5/7 Stefan Hübner : > > OK, I've got it. Thanks, Laurent! > > I would bundle clojure-slim.jar as a "classified" clojure, like Maven > calls it. So the final filename would be "clojure-lang-1.0.0-slim.jar". > > To use this one instead of clojure-lang-1.0.0.jar, the following > dependency needs to be declared: > > > org.clojure > clojure-lang > 1.0.0 > slim > > > -Stefan > > Laurent PETIT writes: > >> 2009/5/7 Stefan Hübner : >>> >>> Laurent PETIT writes: >>> I also think it makes sense to deposit the whole "battery" : clojureXX.jar clojure-slimXX.jar >>> >>> OK, I would bundle clojure-slim.jar too. I'm not familiar with it, though >>> curious. Would you enlighten me by throwing some light on it's purpose? >> >> clojure is divided into clojure files (in folder src/clj/ ) and java >> files (in folder src/jvm/ ) >> >> clojure-slimXX.jar contains compiled java files from src/jvm/ + clj >> files from src/clj/ >> clojureXX.jar contains compiled java files from src/jvm/ + clj files >> from src/clj/ + compiled into java classes cjl files from src/clj/ >> >> clojureXX.jar has a better startup time since clj files are already >> compiled into bytecode into classes files (via AOT - Ahead Of Time - >> clojure files compilation) >> clojure-slimXX.jar is much smaller than clojureXX.jar. And the clj >> files will be compiled into bytecode in memory "Just in Time" >> >> Certainly both serve different needs for different people. >> Regards, > > > > > --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Writer turned programmer seeks string processing advice
2009/5/7 dhs827 : > > Thanks, everybody. The buzz at Hacker News is that the Clojure > community is awesome, and the buzz is right. > > Now, to me, it follows from the advice you gave that I should do two > projects: > > 1. Learn Clojure by implementing (some of) AIML (about half of the > language is of no interest to me) > 2. Implement what I prototyped in AIML (context, objects, processes) > in Clojure For 2., you could even consider, rather than manually doing the conversion, write (in clojure of course, with the help of the xml parsing tools already available) a AIML to clojure-AIML converter :-) (But it really depends on the total estimated time of (your current AIML codebase size, multiplied by the number of times you may have to redo the manual conversion if you change the design of clojure-AIML, multiplied by the mean time of doing the conversion manually), versus the whole time to write and polish an automatic converter :-) -- Laurent > > Does this sound right? > > Dirk > > > Luke VanderHart schrieb: >> On May 6, 4:39 am, dhs827 wrote: >> > I realize now that there is no quick fix, and I'll have to learn a >> > lot to do this properly. But are there already enough resources so >> > that I can learn how to do it in Clojure? For example, would there be >> > enough about string processing in "Programming Clojure" to learn it >> > from theere? >> >> Clojure itself is very well documented for a language that's been out >> for less than two years, and as you can see, there is an active >> community to turn to for help. With persistence, it's very possible to >> become a Clojure expert in a short amount of time. I don't imagine >> you'll have any problem with the language itself. >> >> You'll probably have to get some books or look elsewhere for help with >> the actual algorithms specific to this problem domain, though - I >> doubt there's any Clojure tutorials dedicated specifically to pattern >> matching or AI. But anything that can be implemented in another >> language can be implemented (probably better) in Clojure, so if you >> know Clojure and you can at least read the examples in the AI >> literature, you should be good to go. >> >> -Luke > > > --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: clojure.contrib.test-is/run-tests throws Wrong number of args passed to: test-is$report
Hi Stephane, Sorry about this; it was my fault. Should be fixed now, contrib SVN rev. 773. -Stuart Sierra On May 7, 8:27 am, stephaner wrote: > Hi everyone, > > I've upgrade to the lastest release, i'm trying under Emacs to run- > tests and now I receive the following error: > > We evaluating: (run-tests 'konato.ode.tests.test-ode) > > I receive: > > java.lang.RuntimeException: java.lang.IllegalArgumentException: Wrong > number of args passed to: test-is$report (NO_SOURCE_FILE:0) > [Thrown class clojure.lang.Compiler$CompilerException] > > I did remove all the src repertories and did a complete rebuild of > clojure. Tried with clojure 1.0.0 got the same thing. > > This seems related to emacs slime or a way clojure handle repertory > reference , I can still run my test into a clojure repl started in the > shell. > > Another little change, that might be related: > Before in emacs I was able to evaluate correctly: > (load-file "prjode/src/konato/ode/tests/test_ode.clj") > > Now, I have to add the full path: > (load-file "/home/stephane/prjode/src/konato/ode/tests/test_ode.clj") > > Here is my clojure starting script: > #!/bin/sh -e > > JAVA=java > CLJ_DIR=$HOME/src/clojure > CLOJURE=$CLJ_DIR/clojure.jar > CONTRIB=$HOME/src/clojure-contrib/clojure-contrib.jar > #JLINE=$HOME/src/jline-0.9.94/jline-0.9.94.jar > > ODE=$HOME/prjode/src/ > > #CP=$PWD:$CLOJURE:$JLINE:$CONTRIB:$ODE: > CP=$PWD:$CLOJURE:$CONTRIB:$ODE:. > java -server \ > -Xdebug - > Xrunjdwp:transport=dt_socket,server=y,suspend=n,address= \ > -cp $CP clojure.lang.Repl > > Thank you, > > Stephane --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: HTTP clients in clojure
On May 6, 8:34 pm, Eric Tschetter wrote: > I'm wonder if such a thing exists, or has everyone basically > just rolled their own wrapper on top of their favorite Java HTTP > client library? I just use the Apache Commons HTTP client. -SS --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
Laurent PETIT writes: > Seems fine to me. > > One question, though: I see that you want to name the artifact > "clojure-lang" and not just "clojure". > Why not just "clojure" as is the case for the ant build script ? > > I guess this could just confuse people ? Very good point! That's exactly the kind of feedback I was hoping to get. Pushing a library to Maven Central isn't easy to rewind, if it's possible at all. So I want to make sure beforehand, that the right thing is going to get there. So, here's my explanation, and I hope it is reasonable: I just used the artifactId which is defined in the pom.xml shipped with Clojure since r502 (2007-10-30). Why "clojure-lang" was chosen in favour of just "clojure" confused me too, so I can not give a good explanation. Maybe Rich or the original contributor can? But, since Clojure has shipped this artifactId for 18 months now, it has materialized in many people's repo like that, I guess. In fact, the official 1.0 distribution "clojure-1.0.0.zip" has been shipped with this pom.xml. It seems a matter of fact, that in the maven world Clojure sails under the "clojure-lang" flag since day zero. So I refused to change that quasi-standard, as I don't want to confuse other people, who got used to "clojure-lang" in their maven world. What shall we do then? -Stefan --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Enlive questions
On May 6, 1:36 am, Christophe Grand wrote: > Hello Ryan, > > rzeze...@gmail.com a écrit :> Either I've missed something, orEnlive*appears* > to have problems > > handling comment tags. > > Indeed. I pushed a fix, please tell me whether it works for you now. > > Thanks for the report. > > Christophe > > -- > Professional:http://cgrand.net/(fr) > On Clojure:http://clj-me.blogspot.com/(en) Works fine now. Thanks for the quick response, and for Enlive! --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
2009/5/7 Stefan Hübner : > > Laurent PETIT writes: > >> Seems fine to me. >> >> One question, though: I see that you want to name the artifact >> "clojure-lang" and not just "clojure". >> Why not just "clojure" as is the case for the ant build script ? >> >> I guess this could just confuse people ? > > Very good point! That's exactly the kind of feedback I was hoping to > get. Pushing a library to Maven Central isn't easy to rewind, if it's > possible at all. So I want to make sure beforehand, that the right thing > is going to get there. > > So, here's my explanation, and I hope it is reasonable: > > I just used the artifactId which is defined in the pom.xml > shipped with Clojure since r502 (2007-10-30). Why "clojure-lang" was > chosen in favour of just "clojure" confused me too, so I can not give a > good explanation. Maybe Rich or the original contributor can? > > But, since Clojure has shipped this artifactId for 18 months now, it has > materialized in many people's repo like that, I guess. In fact, the > official 1.0 distribution "clojure-1.0.0.zip" has been shipped with this > pom.xml. It seems a matter of fact, that in the maven world Clojure > sails under the "clojure-lang" flag since day zero. > > So I refused to change that quasi-standard, as I don't want to confuse > other people, who got used to "clojure-lang" in their maven world. > > What shall we do then? > -Stefan You're right, so from the beginning the ant script creates "clojure..." while the maven script creates "clojure-lang...". Well, I thought that since the official build script is the ant one, the pom.xml should be adapted. In either cases, people will have to change things ... I guess only Rich can make the choice: statu quo, clojure (breaks maven artifact id), clojure-lang (breaks build.xml). -- Laurent --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
> I guess only Rich can make the choice: statu quo, clojure (breaks > maven artifact id), clojure-lang (breaks build.xml). Not that I have a strong stake in this, but I'd vote for going with "clojure" and getting it right for 1.0. - J. --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
Laurent PETIT writes: > You're right, so from the beginning the ant script creates > "clojure..." while the maven script creates "clojure-lang...". To be precise here, there's no such maven script that creates "clojure-lang", neither does Maven do anything during Clojure's build process. The pom.xml is created by Ant too. > Well, I thought that since the official build script is the ant one, > the pom.xml should be adapted. In either cases, people will have to > change things ... > > I guess only Rich can make the choice: statu quo, clojure (breaks > maven artifact id), clojure-lang (breaks build.xml). I second your notion. I guess Howard Lewis Ship ought to get involved here too, since he maintains the continuous builds and seems to have his own build scripts, as long as I'm right. Are they monitoring this thread? -Stefan --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: clojure.contrib.test-is/run-tests throws Wrong number of args passed to: test-is$report
Hi Mr. Sierra, I still have the same error after rebuild. Here is my clj-build script: #!/bin/sh -e CLJ_ROOT=/home/stephane/src export CLJ_ROOT cd $CLJ_ROOT rm -dfr clojure rm -dfr clojure-contrib rm -dfr clojure-mode rm -dfr swank-clojure rm -dfr slime svn checkout http://clojure.googlecode.com/svn/trunk/ clojure git clone git://github.com/jochu/clojure-mode.git git clone git://github.com/jochu/swank-clojure.git svn checkout http://clojure-contrib.googlecode.com/svn/trunk/ clojure- contrib cvs -d :pserver:anonymous:anonym...@common-lisp.net:/project/slime/ cvsroot co slime cd clojure ant cd - cd clojure-contrib ant -Dclojure.jar=/home/stephane/src/clojure/clojure.jar Here is the contrib version I have: svn checkout http://clojure-contrib.googlecode.com/svn/trunk/ clojure- contrib Checked out revision 773. But running from REPL in shell is ok: Clojure 1.1.0-alpha-SNAPSHOT user=> (load-file "/home/stephane/prjode/src/konato/ode/tests/ test_ode.clj") nil user=> (run-tests 'konato.ode.tests.test- ode) Testing konato.ode.tests.test-ode Ran 9 tests containing 21 assertions. 0 failures, 0 errors. nil user=> May be I do not take a good release of the other component for emacs slime, swank? Thank you, Stephane __/) On May 7, 10:01 am, Stuart Sierra wrote: > Hi Stephane, > Sorry about this; it was my fault. Should be fixed now, contrib SVN > rev. 773. > -Stuart Sierra > > On May 7, 8:27 am, stephaner wrote: > > > Hi everyone, > > > I've upgrade to the lastest release, i'm trying under Emacs to run- > > tests and now I receive the following error: > > > We evaluating: (run-tests 'konato.ode.tests.test-ode) > > > I receive: > > > java.lang.RuntimeException: java.lang.IllegalArgumentException: Wrong > > number of args passed to: test-is$report (NO_SOURCE_FILE:0) > > [Thrown class clojure.lang.Compiler$CompilerException] > > > I did remove all the src repertories and did a complete rebuild of > > clojure. Tried with clojure 1.0.0 got the same thing. > > > This seems related to emacs slime or a way clojure handle repertory > > reference , I can still run my test into a clojure repl started in the > > shell. > > > Another little change, that might be related: > > Before in emacs I was able to evaluate correctly: > > (load-file "prjode/src/konato/ode/tests/test_ode.clj") > > > Now, I have to add the full path: > > (load-file "/home/stephane/prjode/src/konato/ode/tests/test_ode.clj") > > > Here is my clojure starting script: > > #!/bin/sh -e > > > JAVA=java > > CLJ_DIR=$HOME/src/clojure > > CLOJURE=$CLJ_DIR/clojure.jar > > CONTRIB=$HOME/src/clojure-contrib/clojure-contrib.jar > > #JLINE=$HOME/src/jline-0.9.94/jline-0.9.94.jar > > > ODE=$HOME/prjode/src/ > > > #CP=$PWD:$CLOJURE:$JLINE:$CONTRIB:$ODE: > > CP=$PWD:$CLOJURE:$CONTRIB:$ODE:. > > java -server \ > > -Xdebug - > > Xrunjdwp:transport=dt_socket,server=y,suspend=n,address= \ > > -cp $CP clojure.lang.Repl > > > Thank you, > > > Stephane --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
2009/5/7 Stefan Hübner : > > Laurent PETIT writes: > >> You're right, so from the beginning the ant script creates >> "clojure..." while the maven script creates "clojure-lang...". > > To be precise here, there's no such maven script that creates > "clojure-lang", neither does Maven do anything during Clojure's build > process. The pom.xml is created by Ant too. I know(*) :-), but it's a recent addition. The name "clojure-lang" was there before ant creating the pom from pom-template, and this artifactId name was not even closely reviewed during the process. > >> Well, I thought that since the official build script is the ant one, >> the pom.xml should be adapted. In either cases, people will have to >> change things ... >> >> I guess only Rich can make the choice: statu quo, clojure (breaks >> maven artifact id), clojure-lang (breaks build.xml). > > I second your notion. I guess Howard Lewis Ship ought to get involved > here too, since he maintains the continuous builds and seems to have his > own build scripts, as long as I'm right. Are they monitoring this > thread? I think so. > > -Stefan (*) I did the patch that made pom.xml generated from build.xml --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Overlapping IO with processing
I have a 25Mb CSV text file that I want to process. Simply running (time (dorun (read-lines "file"))) gives me about 1 second of read time, which is about as fast as you'll get (on my machine) I think. I believe that it should be possible to overlap the IO cost of reading from a file with processing cost, so that I should be able to do almost 1 second of processing on the data entirely in parallel. But I can't do it! I was trying things like (let [lines (read-lines "file")] (future (dorun lines)) ; pre-fetch lines in the background (time (dorun (map some-func lines Which is a bit hacky, but should basically work in my mind. (As an aside, how does the seq caching work? Where in the code is it implemented?) But it doesn't work :( - the time it takes to map some-func across the list is IO + compute, not (max IO-time compute-time). If I sleep for a while between, then the compute time goes way down. This also leads me to think that it would be useful to have a function that precached a lazy seq, ie (pre-cache-seq 5 (range 1000)); returns a new lazy-seq that will keep 5 elements ahead by precaching on another thread. Any ideas on what I'm doing wrong? Thanks, Brad PS - I don't really care about 1 second of runtime, it's the concept I care about. --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: clojure.contrib.test-is/run-tests throws Wrong number of args passed to: test-is$report
Now I'm on revision 774 of clojure-contrib but still have the error: java.lang.IllegalArgumentException: Wrong number of args passed to: test-is$report [Thrown class java.lang.RuntimeException] Restarts: 0: [ABORT] Return to SLIME's top level. 1: [CAUSE] Throw cause of this exception Backtrace: 0: clojure.lang.LazySeq.seq(LazySeq.java:46) 1: clojure.lang.RT.seq(RT.java:436) 2: clojure.core$seq__3133.invoke(core.clj:103) 3: clojure.core$spread__3240.invoke(core.clj:383) 4: clojure.core$spread__3240.invoke(core.clj:384) 5: clojure.core$apply__3243.doInvoke(core.clj:390) 6: clojure.lang.RestFn.invoke(RestFn.java:443) 7: clojure.contrib.test_is$run_tests__5028.doInvoke(test_is.clj:914) 8: clojure.lang.RestFn.invoke(RestFn.java:413) 9: user$eval__1799.invoke(NO_SOURCE_FILE:1) 10: clojure.lang.Compiler.eval(Compiler.java:4532) 11: clojure.core$eval__3990.invoke(core.clj:1728) 12: swank.commands.basic$eval_region__774.invoke(basic.clj:36) 13: swank.commands.basic$listener_eval__783.invoke(basic.clj:50) 14: clojure.lang.Var.invoke(Var.java:346) 15: user$eval__1796.invoke(NO_SOURCE_FILE) 16: clojure.lang.Compiler.eval(Compiler.java:4532) 17: clojure.core$eval__3990.invoke(core.clj:1728) 18: swank.core$eval_in_emacs_package__395.invoke(core.clj:55) 19: swank.core$eval_for_emacs__472.invoke(core.clj:123) 20: clojure.lang.Var.invoke(Var.java:354) 21: clojure.lang.AFn.applyToHelper(AFn.java:179) 22: clojure.lang.Var.applyTo(Var.java:463) 23: clojure.core$apply__3243.doInvoke(core.clj:390) 24: clojure.lang.RestFn.invoke(RestFn.java:428) 25: swank.core$eval_from_control__398.invoke(core.clj:62) 26: swank.core$eval_loop__401.invoke(core.clj:67) 27: swank.core$spawn_repl_thread__533$fn__564$fn__566.invoke(core.clj: 173) 28: clojure.lang.AFn.applyToHelper(AFn.java:171) 29: clojure.lang.AFn.applyTo(AFn.java:164) 30: clojure.core$apply__3243.doInvoke(core.clj:390) 31: clojure.lang.RestFn.invoke(RestFn.java:428) 32: swank.core$spawn_repl_thread__533$fn__564.doInvoke(core.clj:170) 33: clojure.lang.RestFn.invoke(RestFn.java:402) 34: clojure.lang.AFn.run(AFn.java:37) 35: java.lang.Thread.run(Thread.java:619) On May 7, 10:57 am, stephaner wrote: > Hi Mr. Sierra, > > I still have the same error after rebuild. Here is my clj-build > script: > #!/bin/sh -e > CLJ_ROOT=/home/stephane/src > > export CLJ_ROOT > > cd $CLJ_ROOT > rm -dfr clojure > rm -dfr clojure-contrib > rm -dfr clojure-mode > rm -dfr swank-clojure > rm -dfr slime > svn checkouthttp://clojure.googlecode.com/svn/trunk/clojure > git clone git://github.com/jochu/clojure-mode.git > git clone git://github.com/jochu/swank-clojure.git > svn checkouthttp://clojure-contrib.googlecode.com/svn/trunk/clojure- > contrib > cvs -d :pserver:anonymous:anonym...@common-lisp.net:/project/slime/ > cvsroot co slime > cd clojure > ant > cd - > cd clojure-contrib > ant -Dclojure.jar=/home/stephane/src/clojure/clojure.jar > > Here is the contrib version I have: > > svn checkouthttp://clojure-contrib.googlecode.com/svn/trunk/clojure- > contrib > Checked out revision 773. > > But running from REPL in shell is ok: > Clojure 1.1.0-alpha-SNAPSHOT > user=> (load-file "/home/stephane/prjode/src/konato/ode/tests/ > test_ode.clj") > nil > user=> (run-tests 'konato.ode.tests.test- > ode) > > Testing konato.ode.tests.test-ode > > Ran 9 tests containing 21 assertions. > 0 failures, 0 errors. > nil > user=> > > May be I do not take a good release of the other component for emacs > slime, swank? > > Thank you, > > Stephane __/) > > On May 7, 10:01 am, Stuart Sierra wrote: > > > Hi Stephane, > > Sorry about this; it was my fault. Should be fixed now, contrib SVN > > rev. 773. > > -Stuart Sierra > > > On May 7, 8:27 am, stephaner wrote: > > > > Hi everyone, > > > > I've upgrade to the lastest release, i'm trying under Emacs to run- > > > tests and now I receive the following error: > > > > We evaluating: (run-tests 'konato.ode.tests.test-ode) > > > > I receive: > > > > java.lang.RuntimeException: java.lang.IllegalArgumentException: Wrong > > > number of args passed to: test-is$report (NO_SOURCE_FILE:0) > > > [Thrown class clojure.lang.Compiler$CompilerException] > > > > I did remove all the src repertories and did a complete rebuild of > > > clojure. Tried with clojure 1.0.0 got the same thing. > > > > This seems related to emacs slime or a way clojure handle repertory > > > reference , I can still run my test into a clojure repl started in the > > > shell. > > > > Another little change, that might be related: > > > Before in emacs I was able to evaluate correctly: > > > (load-file "prjode/src/konato/ode/tests/test_ode.clj") > > > > Now, I have to add the full path: > > > (load-file "/home/stephane/prjode/src/konato/ode/tests/test_ode.clj") > > > > Here is my clojure starting script: > > > #!/bin/sh -e > > > > JAVA=java > > > CLJ_DIR=$HOME/src/clojure > > > CLOJURE=$CLJ_DIR/clojure.jar > > > CONTRIB=$HOME/src/clojure-contrib/clojure-contrib.jar > >
Re: Overlapping IO with processing
2009/5/7 Bradbev : > > I have a 25Mb CSV text file that I want to process. Simply running > (time (dorun (read-lines "file"))) gives me about 1 second of read > time, which is about as fast as you'll get (on my machine) I think. > I believe that it should be possible to overlap the IO cost of reading > from a file with processing cost, so that I should be able to do > almost 1 second of processing on the data entirely in parallel. But I > can't do it! > > I was trying things like > (let [lines (read-lines "file")] > (future (dorun lines)) ; pre-fetch lines in the background > (time (dorun (map some-func lines > > Which is a bit hacky, but should basically work in my mind. > (As an aside, how does the seq caching work? Where in the code is it > implemented?) > > But it doesn't work :( - the time it takes to map some-func across the > list is IO + compute, not (max IO-time compute-time). If I sleep for > a while between, then the compute time goes way down. Are you sure you have more than one core ? (ok, just joking :-) > This also leads me to think that it would be useful to have a function > that precached a lazy seq, ie > (pre-cache-seq 5 (range 1000)); returns a new lazy-seq that will keep > 5 elements ahead by precaching on another thread. wouldn't that be your (future (take 5 (range 1000))) trick ? --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: clojure.contrib.test-is/run-tests throws Wrong number of args passed to: test-is$report
Current finding, run-tests works in a shell with a REPL and in vim- clojure: Testing konato.ode.tests.test-ode Ran 9 tests containing 21 assertions. 0 failures, 0 errors. nil But still doesn't work on Emacs. Thank you, Stephane On May 7, 11:20 am, stephaner wrote: > Now I'm on revision 774 of clojure-contrib but still have the error: > > java.lang.IllegalArgumentException: Wrong number of args passed to: > test-is$report > [Thrown class java.lang.RuntimeException] > > Restarts: > 0: [ABORT] Return to SLIME's top level. > 1: [CAUSE] Throw cause of this exception > > Backtrace: > 0: clojure.lang.LazySeq.seq(LazySeq.java:46) > 1: clojure.lang.RT.seq(RT.java:436) > 2: clojure.core$seq__3133.invoke(core.clj:103) > 3: clojure.core$spread__3240.invoke(core.clj:383) > 4: clojure.core$spread__3240.invoke(core.clj:384) > 5: clojure.core$apply__3243.doInvoke(core.clj:390) > 6: clojure.lang.RestFn.invoke(RestFn.java:443) > 7: clojure.contrib.test_is$run_tests__5028.doInvoke(test_is.clj:914) > 8: clojure.lang.RestFn.invoke(RestFn.java:413) > 9: user$eval__1799.invoke(NO_SOURCE_FILE:1) > 10: clojure.lang.Compiler.eval(Compiler.java:4532) > 11: clojure.core$eval__3990.invoke(core.clj:1728) > 12: swank.commands.basic$eval_region__774.invoke(basic.clj:36) > 13: swank.commands.basic$listener_eval__783.invoke(basic.clj:50) > 14: clojure.lang.Var.invoke(Var.java:346) > 15: user$eval__1796.invoke(NO_SOURCE_FILE) > 16: clojure.lang.Compiler.eval(Compiler.java:4532) > 17: clojure.core$eval__3990.invoke(core.clj:1728) > 18: swank.core$eval_in_emacs_package__395.invoke(core.clj:55) > 19: swank.core$eval_for_emacs__472.invoke(core.clj:123) > 20: clojure.lang.Var.invoke(Var.java:354) > 21: clojure.lang.AFn.applyToHelper(AFn.java:179) > 22: clojure.lang.Var.applyTo(Var.java:463) > 23: clojure.core$apply__3243.doInvoke(core.clj:390) > 24: clojure.lang.RestFn.invoke(RestFn.java:428) > 25: swank.core$eval_from_control__398.invoke(core.clj:62) > 26: swank.core$eval_loop__401.invoke(core.clj:67) > 27: swank.core$spawn_repl_thread__533$fn__564$fn__566.invoke(core.clj: > 173) > 28: clojure.lang.AFn.applyToHelper(AFn.java:171) > 29: clojure.lang.AFn.applyTo(AFn.java:164) > 30: clojure.core$apply__3243.doInvoke(core.clj:390) > 31: clojure.lang.RestFn.invoke(RestFn.java:428) > 32: swank.core$spawn_repl_thread__533$fn__564.doInvoke(core.clj:170) > 33: clojure.lang.RestFn.invoke(RestFn.java:402) > 34: clojure.lang.AFn.run(AFn.java:37) > 35: java.lang.Thread.run(Thread.java:619) > > On May 7, 10:57 am, stephaner wrote: > > > Hi Mr. Sierra, > > > I still have the same error after rebuild. Here is my clj-build > > script: > > #!/bin/sh -e > > CLJ_ROOT=/home/stephane/src > > > export CLJ_ROOT > > > cd $CLJ_ROOT > > rm -dfr clojure > > rm -dfr clojure-contrib > > rm -dfr clojure-mode > > rm -dfr swank-clojure > > rm -dfr slime > > svn checkouthttp://clojure.googlecode.com/svn/trunk/clojure > > git clone git://github.com/jochu/clojure-mode.git > > git clone git://github.com/jochu/swank-clojure.git > > svn checkouthttp://clojure-contrib.googlecode.com/svn/trunk/clojure- > > contrib > > cvs -d :pserver:anonymous:anonym...@common-lisp.net:/project/slime/ > > cvsroot co slime > > cd clojure > > ant > > cd - > > cd clojure-contrib > > ant -Dclojure.jar=/home/stephane/src/clojure/clojure.jar > > > Here is the contrib version I have: > > > svn checkouthttp://clojure-contrib.googlecode.com/svn/trunk/clojure- > > contrib > > Checked out revision 773. > > > But running from REPL in shell is ok: > > Clojure 1.1.0-alpha-SNAPSHOT > > user=> (load-file "/home/stephane/prjode/src/konato/ode/tests/ > > test_ode.clj") > > nil > > user=> (run-tests 'konato.ode.tests.test- > > ode) > > > Testing konato.ode.tests.test-ode > > > Ran 9 tests containing 21 assertions. > > 0 failures, 0 errors. > > nil > > user=> > > > May be I do not take a good release of the other component for emacs > > slime, swank? > > > Thank you, > > > Stephane __/) > > > On May 7, 10:01 am, Stuart Sierra wrote: > > > > Hi Stephane, > > > Sorry about this; it was my fault. Should be fixed now, contrib SVN > > > rev. 773. > > > -Stuart Sierra > > > > On May 7, 8:27 am, stephaner wrote: > > > > > Hi everyone, > > > > > I've upgrade to the lastest release, i'm trying under Emacs to run- > > > > tests and now I receive the following error: > > > > > We evaluating: (run-tests 'konato.ode.tests.test-ode) > > > > > I receive: > > > > > java.lang.RuntimeException: java.lang.IllegalArgumentException: Wrong > > > > number of args passed to: test-is$report (NO_SOURCE_FILE:0) > > > > [Thrown class clojure.lang.Compiler$CompilerException] > > > > > I did remove all the src repertories and did a complete rebuild of > > > > clojure. Tried with clojure 1.0.0 got the same thing. > > > > > This seems related to emacs slime or a way clojure handle repertory > > > > reference , I can still run my test into a clojure repl started in the > > > > shell. > > >
Re: clojure.contrib.test-is/run-tests throws Wrong number of args passed to: test-is$report
stephaner writes: > Current finding, run-tests works in a shell with a REPL and in vim- > clojure: > Testing konato.ode.tests.test-ode > > Ran 9 tests containing 21 assertions. > 0 failures, 0 errors. > nil > > But still doesn't work on Emacs. It sounds like you're using an old version of clojure-test-mode. It actually wraps the "report" function of test-is to give a better summary from within Emacs. But that function changed in a recent test-is revision (a couple weeks before 1.0 was released) so the modifications that the old clojure-test-mode does won't work. I've updated clojure-test-mode so it works with the latest test-is. Just grab the latest from my repository: http://github.com/technomancy/clojure-mode If you installed via ELPA, I haven't gotten my changes to their servers yet, so you'll have to remove the ELPA-installed copy and install manually for now. Sorry for the confusion. -Phil --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
gen-class :exposes-methods
I am having trouble calling a superclass implementation from an overridden method. I have read the documentation for gen- class :exposes-methods and looked at the examples on github. When I examine the class file, I find no local method for the exposed method. Here are the relevant code fragments and the error message produced when I call the overridden method. Any suggestions? (ns stackcalc.cimpl.StackCalcGUI (:import (javax...) (java...) (stackcalc.cimpl StackCalcGUI)) (:gen-class :implements [stackcalc.common.IStackCalcGUI] :constructors {[stackcalc.common.IStackCalc][]} :state state :init init :exposes-methods {setVisible superSetVisible} :methods [#^{:static true} [newGUI [stackcalc.common.IStackCalc] stackcalc.common.IStackCalcGUI]] )) (defn -setVisible "Make this GUI visible (true) or invisible (false)." [this #^Boolean/TYPE visible] (.superSetVisible this visible)) Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: No matching method found: superSetVisible for class stackcalc.cimpl.StackCalcGUI at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:50) at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28) at stackcalc.cimpl.StackCalcGUI$_setVisible__179.invoke (StackCalcGUI.clj:234) Bruce --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Overlapping IO with processing
Hi, Am 07.05.2009 um 17:19 schrieb Bradbev: This also leads me to think that it would be useful to have a function that precached a lazy seq, ie (pre-cache-seq 5 (range 1000)); returns a new lazy-seq that will keep 5 elements ahead by precaching on another thread. Maybe clojure.core/seque might help you? Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature
Re: clojure.contrib.test-is/run-tests throws Wrong number of args passed to: test-is$report
Hi Phil, It does work now: user=> user=> (load-file "/home/stephane/prjode/src/konato/ode/tests/ test_ode.clj") (load-file "/home/stephane/prjode/src/konato/ode/tests/test_ode.clj") nil user=> (run-tests 'konato.ode.tests.test-ode) (run-tests 'konato.ode.tests.test-ode) Testing konato.ode.tests.test-ode Ran 9 tests containing 21 assertions. 0 failures, 0 errors. nil user=> Here is my corrected clj-build script: #!/bin/sh -e CLJ_ROOT=/home/stephane/src export CLJ_ROOT cd $CLJ_ROOT rm -dfr clojure rm -dfr clojure-contrib rm -dfr clojure-mode rm -dfr swank-clojure rm -dfr slime svn checkout http://clojure.googlecode.com/svn/trunk/ clojure git clone git://github.com/technomancy/clojure-mode.git git clone git://github.com/jochu/swank-clojure.git svn checkout http://clojure-contrib.googlecode.com/svn/trunk/ clojure- contrib cvs -d :pserver:anonymous:anonym...@common-lisp.net:/project/slime/ cvsroot co slime cd clojure ant cd - cd clojure-contrib ant -Dclojure.jar=/home/stephane/src/clojure/clojure.jar Now, I have a little problem with the eval line but will continue my research. Thank you very much, Stephane __/) On May 7, 12:01 pm, Phil Hagelberg wrote: > stephaner writes: > > Current finding, run-tests works in a shell with a REPL and in vim- > > clojure: > > Testing konato.ode.tests.test-ode > > > Ran 9 tests containing 21 assertions. > > 0 failures, 0 errors. > > nil > > > But still doesn't work on Emacs. > > It sounds like you're using an old version of clojure-test-mode. It > actually wraps the "report" function of test-is to give a better summary > from within Emacs. But that function changed in a recent test-is > revision (a couple weeks before 1.0 was released) so the modifications > that the old clojure-test-mode does won't work. > > I've updated clojure-test-mode so it works with the latest test-is. Just > grab the latest from my repository: > > http://github.com/technomancy/clojure-mode > > If you installed via ELPA, I haven't gotten my changes to their servers > yet, so you'll have to remove the ELPA-installed copy and install > manually for now. > > Sorry for the confusion. > > -Phil --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Overlapping IO with processing
On May 7, 9:26 am, Meikel Brandmeyer wrote: > Hi, > > Am 07.05.2009 um 17:19 schrieb Bradbev: > > > This also leads me to think that it would be useful to have a function > > that precached a lazy seq, ie > > (pre-cache-seq 5 (range 1000)); returns a new lazy-seq that will keep > > 5 elements ahead by precaching on another thread. > > Maybe clojure.core/seque might help you? > I didn't know about that function, and it does look exactly like what I want. Except that using it is slower :( (time (dorun (map identity (read-lines "file"))) "Elapsed time: 673.319593 msecs" user> (time (dorun (map identity (seque (read-lines "file"))) "Elapsed time: 3959.109581 msecs" Cheers, Brad --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Writer turned programmer seeks string processing advice
Laurent PETIT wrote: > For 2., you could even consider, rather than manually doing the > conversion, write (in clojure of course, with the help of the xml > parsing tools already available) a AIML to clojure-AIML converter :-) Most of the work will be about figuring out how to map the functional structure from an implementation in a small and specialized language to one in a large and general language - how do I express this or that idea? There are two parts to my prototype; there's a small one I call the "grammar", ~200 AIML categories which do all the algorithmic heavy lifting, making use of AIML specialties like conditional branching by recursively matching arbitrary variables, where you can just pass to make magic happen - how can I translate this into Clojure? That's not going to be much code, but its likely to be very dense (there are eight years of learning in those 200 AIML categories). So I suspect it'll take me a while until I understand what I need, and I'll not have much code to show for it. And then there's the "lexicon", where the content, the words, are encoded as pseudo-objects. These are just files of simple AIML categories, doing mostly substitution and value returns. But lots of them, because AIML was never meant to have "objects", so a lot of boilerplate goes into simulating them. However, it worked, basically, but when the whole hootenanny was finally running with a 200 word lexicon, it became clear that the interpreter would blow the lid after 10-12 strokes. Again, translating the ideas will be the challenge; there's just not much code relative to the amount of ideas cristallized there, because AIML is so specialized on this, and the code was developed and optimized over the course of eight years. Once I "got" it, I expect the Clojure implementation to take a number of parameters from the programmer/writer and create the appropriate object automatically. But that's the vision - I've not even learned the basics yet. Dirk --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Getting slime-edit-definition to work with Clojure
Baishampayan Ghose writes: >> It looks like you're using a wrapper script rather than letting >> swank-clojure construct a "java" command-line invocation. I'm not sure >> why you're doing this; working with the defaults might fix it. > > Many thanks. Just using the conf generated by clojure-install did the > trick. Right now M-. for all clojure.contrib functions work fine. > > But it still doesn't work for Clojure's internal functions in, say, core.clj Not sure, but it could be due to your Clojure copy being AOT compiled without having the original .clj file around? That'd be my guess. Take a look inside your jar or classes directory and see if it just includes the .class files or everything. -Phil --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
[PATCH] contrib: Several namespaces are left uncompiled for seemingly no reason
As stated in the subject, the clojure-contrib build process doesn't compile all namespaces. Some of them of course must not be compiled (like macro-apply, due to its evilness), but as far as I can tell, some were simply missing from the build file. I have a patch here: http://www.modeemi.fi/~oranenj/add-namespaces.patch (sha1 for the paranoid: bf3ef8bebc7b3e02ec14931d2a9242236f0fd36b) I'm not certain I got all of the namespaces with my cursory audit either; or if it even makes sense to compile all of them. Nevertheless, I have no trouble building contrib with Java 1.5 on OS X 10.5.6 with the patch applied, so it should be safe. Comments? Did I miss anything? :) -- Jarkko --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Getting slime-edit-definition to work with Clojure
Phil Hagelberg wrote: >> But it still doesn't work for Clojure's internal functions in, say, core.clj > > Not sure, but it could be due to your Clojure copy being AOT compiled > without having the original .clj file around? That'd be my guess. Take > a look inside your jar or classes directory and see if it just includes > the .class files or everything. That's right. The clojure.jar that I am using contains only the AOT compiled .class files. Should I use the "slim" jar instead? Which one do you use? Is there any way to have a jar file with both .class & .clj files? Regards, BG -- Baishampayan Ghose oCricket.com --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Getting slime-edit-definition to work with Clojure
On May 7, 2009, at 2:37 PM, Baishampayan Ghose wrote: That's right. The clojure.jar that I am using contains only the AOT compiled .class files. The default "ant" build includes both compiled files and sources in the clojure.jar it produces. Should I use the "slim" jar instead? The clojure-slim jar contains compiled Java code, but only sources for Clojure code. You would be sure to have Clojure sources in that case. The downside is slower startup time. Which one do you use? It's working for me with a clojure.jar built from a recent SVN Checkout using ant. Is there any way to have a jar file with both .class & .clj files? Yes. As a sanity check you might try with clojure 1.0. I've confirmed that clojure-1.0.0.jar includes both .class files and .clj files for the Clojure code. The source files appear down at the bottom when listing the jar directory with: jar -tf clojure-1.0.0.jar Download URL: http://clojure.googlecode.com/files/clojure_1.0.0.zip --Steve smime.p7s Description: S/MIME cryptographic signature
Re: gen-class :exposes-methods
Hi Bruce, It looks like your namespace only implements an interface, rather than extending a class. You need an ":extends..." line in your (:gen- class...) to set the concrete base class. -Stuart Sierra On May 7, 12:26 pm, gun43 wrote: > I am having trouble calling a superclass implementation from an > overridden method. I have read the documentation for gen- > class :exposes-methods and looked at the examples on github. When I > examine the class file, I find no local method for the exposed method. > Here are the relevant code fragments and the error message produced > when I call the overridden method. > > Any suggestions? > > (ns stackcalc.cimpl.StackCalcGUI > (:import > (javax...) > (java...) > (stackcalc.cimpl StackCalcGUI)) > (:gen-class > :implements [stackcalc.common.IStackCalcGUI] > :constructors {[stackcalc.common.IStackCalc][]} > :state state > :init init > :exposes-methods {setVisible superSetVisible} > :methods [#^{:static true} [newGUI > [stackcalc.common.IStackCalc] > stackcalc.common.IStackCalcGUI]] > )) > > (defn -setVisible > "Make this GUI visible (true) or invisible (false)." > [this #^Boolean/TYPE visible] > (.superSetVisible this visible)) > > Exception in thread "AWT-EventQueue-0" > java.lang.IllegalArgumentException: No matching method found: > superSetVisible for class stackcalc.cimpl.StackCalcGUI > at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:50) > at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28) > at stackcalc.cimpl.StackCalcGUI$_setVisible__179.invoke > (StackCalcGUI.clj:234) > > Bruce --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Getting slime-edit-definition to work with Clojure
Steve, I tested with a new jar with the clj files, even then it doesn't work :( My ~/.emacs is thus - ;;; (defvar clj-root (concat (expand-file-name "~") "/src/clj/")) (setq load-path (append (list (concat clj-root "clojure-mode")) load-path)) (require 'clojure-mode) (setq clojure-src-root clj-root) (eval-after-load 'clojure-mode '(clojure-slime-config)) (autoload 'clojure-mode "clojure-mode" "A major mode for Clojure" t) (add-to-list 'auto-mode-alist '("\\.clj$" . clojure-mode)) ;;; Need help :) Regards, BG -- Baishampayan Ghose oCricket.com --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: HTTP clients in clojure
I wrote my own wrapper around the Apache Commons HTTP client, approximately mirroring AllegroServe's HTTP client. I often find myself wanting to react to the HTTP response code and response without the burden of exception handling… after all, a non-200 response is hardly "exceptional", if an exception was the best way to announce a code and body, surely we'd use it for success responses, too… At some point I'll see if I can the OK to publish the source. --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Can "for" be enhanced to not have to take a binding?
I'm trying to accomplish the following: Create a lazy sequence of calls to f() while pred() is true. And an elegant way to do this seems to be: (for [:while (pred)] (f)) which doesn't work because (for) requires a binding. This can be worked around with: (for [i (constantly 0) :while (pred)] (f)) which is not as elegant. Does anyone else think this is a worthwhile to "for"? Thanks for your opinions. -Patrick --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Can "for" be enhanced to not have to take a binding?
user=> (doc take-while) - clojure.core/take-while ([pred coll]) Returns a lazy sequence of successive items from coll while (pred item) returns true. pred must be free of side-effects. nil user=> On Thu, May 7, 2009 at 2:11 PM, CuppoJava wrote: > > I'm trying to accomplish the following: > Create a lazy sequence of calls to f() while pred() is true. > And an elegant way to do this seems to be: > > (for [:while (pred)] (f)) > > which doesn't work because (for) requires a binding. > This can be worked around with: > > (for [i (constantly 0) :while (pred)] (f)) > > which is not as elegant. > > Does anyone else think this is a worthwhile to "for"? Thanks for your > opinions. > -Patrick > > > -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Can "for" be enhanced to not have to take a binding?
Hi, together with repeatedly: (take-while pred (repeatedly f))) Sincerely Meikel Am 07.05.2009 um 23:14 schrieb Kevin Downey: user=> (doc take-while) - clojure.core/take-while ([pred coll]) Returns a lazy sequence of successive items from coll while (pred item) returns true. pred must be free of side-effects. nil user=> On Thu, May 7, 2009 at 2:11 PM, CuppoJava wrote: I'm trying to accomplish the following: Create a lazy sequence of calls to f() while pred() is true. And an elegant way to do this seems to be: (for [:while (pred)] (f)) which doesn't work because (for) requires a binding. This can be worked around with: (for [i (constantly 0) :while (pred)] (f)) which is not as elegant. Does anyone else think this is a worthwhile to "for"? Thanks for your opinions. -Patrick -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~--- smime.p7s Description: S/MIME cryptographic signature
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
On Thu, May 7, 2009 at 4:47 PM, J. McConnell wrote: > >> I guess only Rich can make the choice: statu quo, clojure (breaks >> maven artifact id), clojure-lang (breaks build.xml). > > Not that I have a strong stake in this, but I'd vote for going with > "clojure" and getting it right for 1.0. Right. It's easier to change this pom before it goes into the public repo than after. When people are going to change their pom from some odd snapshot to 1.0 anyway, then this is probably a good time to sneak this artifactId change in too, no? > > - J. > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Can "for" be enhanced to not have to take a binding?
CuppoJava a écrit : > I'm trying to accomplish the following: > Create a lazy sequence of calls to f() while pred() is true. > And an elegant way to do this seems to be: > > (for [:while (pred)] (f)) > > which doesn't work because (for) requires a binding. > This can be worked around with: > > (for [i (constantly 0) :while (pred)] (f)) > (pred) does not depend on (f)? Is there some IO or mutable state? -- Professional: http://cgrand.net/ (fr) On Clojure: http://clj-me.blogspot.com/ (en) --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Can "for" be enhanced to not have to take a binding?
Yeah (pred) is not supposed to depend on any items inside f. This is why (take-while pred (repeatedly f))) won't work in this situation. (take-while) will always take an element out of f, so that it can be tested using (pred). I don't want any elements of (f) to be looked at if (pred) is false. USE CASE I'm using it in combination with some Java libraries. The following seems like a very clojure-ish way of doing things. (for [:while (Mouse/hasEvent)] (Mouse/getEvent)) so this returns a nice lazy stream of mouse events, which can be processed however i like. --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Getting slime-edit-definition to work with Clojure
On May 7, 2009, at 3:39 PM, Baishampayan Ghose wrote: I tested with a new jar with the clj files, even then it doesn't work :( Need help :) Hi BG, I've simplified my .emacs file and clojure launch script to only what's required for my slime setup to work with swank-clojure. With this simplified setup, I confirmed that slime's repl works and that M-. after typing (+ brings me to the definition of + in clojure.core. The way I use slime/swank is to handle all Classpath issues myself in my "swank-clojure-binary" launch script. I've found that setup to break only very rarely with slime/swank/clojure updates. Other strategies may perform equally well or better, but I haven't tried them. In the setup below, "/sq/ext" is a directory where I keep third party source controlled package. I'm running all from the HEAD of their Source Control repository. I did a fresh update just now. Are you able to duplicate this setup to try? --Steve === /sq/ext === cd /sq/ext cvs -d :pserver:anonymous:anonym...@common-lisp.net:/project/slime/ cvsroot co slime git clone git://github.com/jochu/swank-clojure.git svn co http://clojure.googlecode.com/svn/trunk/ clojure svn co http://clojure-contrib.googlecode.com/svn/trunk clojure-contrib === .emacs === (add-to-list 'load-path "/sq/ext/slime") (add-to-list 'load-path "/sq/ext/swank-clojure/") ;; slime (require 'slime) (slime-setup '(slime-repl)) ; (:autodoc t) (define-key global-map (kbd "") 'slime-selector) ;; swank (setq swank-clojure-binary "/sq/bin/clj") (require 'swank-clojure-autoload) === /sq/bin/clj === #!/bin/bash export CLASSPATH=$CLASSPATH:/sq/ext/clojure/clojure.jar CLJ=/sq/ext/clojure-contrib/launchers/bash/clj-env-dir exec $CLJ "$@" === procedure === - cd /sq/ext/clojure - ant - emacs - M-x slime - (+ - M-. --Steve smime.p7s Description: S/MIME cryptographic signature
Re: Can "for" be enhanced to not have to take a binding?
Hi, lazy-seq to the rescue: (defn mouse-seq [] (lazy-seq (when (Mouse/hasEvent) (cons (Mouse/getEvent) (mouse-seq) Sincerely Meikel Am 07.05.2009 um 23:40 schrieb CuppoJava: Yeah (pred) is not supposed to depend on any items inside f. This is why (take-while pred (repeatedly f))) won't work in this situation. (take-while) will always take an element out of f, so that it can be tested using (pred). I don't want any elements of (f) to be looked at if (pred) is false. USE CASE I'm using it in combination with some Java libraries. The following seems like a very clojure-ish way of doing things. (for [:while (Mouse/hasEvent)] (Mouse/getEvent)) so this returns a nice lazy stream of mouse events, which can be processed however i like. --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~--- smime.p7s Description: S/MIME cryptographic signature
Re: Can "for" be enhanced to not have to take a binding?
Thanks Meikel. That certainly works. But don't you find: (for [:while (Mouse/hasEvent)] (Mouse/getEvent)) much shorter and easier to understand? --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Feedback on new persistentmatrix datatype
Can't wait to try this out! --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Can "for" be enhanced to not have to take a binding?
Hi, Am 07.05.2009 um 23:54 schrieb CuppoJava: But don't you find: (for [:while (Mouse/hasEvent)] (Mouse/getEvent)) much shorter and easier to understand? Actually: no. I think of for as a way to transform a sequence, not constructing a completely new one. There are constructs like iterate and repeatedly for that. If they are not sufficient, one can drop to lazy-seq. (And sometimes dropping to lazy-seq can yield clearer code than some contorted map filter concat map combination) In fact I think the lazy-seq version is pretty self-explaining. On the other hand I should use for more often. So maybe this view is all wrong. YMMV in the end. Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature
Re: Can "for" be enhanced to not have to take a binding?
On May 8, 12:54 am, CuppoJava wrote: > Thanks Meikel. > That certainly works. But don't you find: > > (for [:while (Mouse/hasEvent)] (Mouse/getEvent)) > > much shorter and easier to understand? I don't, really. for is a list comprehension, and so it needs bindings... Something to generate the list from. Also, how is a lazy sequence of mouse events supposed to work? does it block? What happens when there is no mouse event? does the sequence just end? What if you happen to take the last event, and then the sequence ends, after which another event comes in? for wouldn't know what to do in the general case. Anyway, I don't think it's worth the trouble; it's not especially functional style either. If you need such a construct, I believe it would be best to make a new function, with a more fitting name. -- Jarkko --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Can "for" be enhanced to not have to take a binding?
Thanks for your replies. I've always thought of "for" as a generator. Basically just a loop that produces a lazy collection. So it actually seems very natural to me. But anyway, I think I shall just write my own generator function using lazy-seq and be done with it then. Again, thanks for offering your opinions. They were insightful. -Patrick --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
Christian Vest Hansen writes: > On Thu, May 7, 2009 at 4:47 PM, J. McConnell wrote: >> >>> I guess only Rich can make the choice: statu quo, clojure (breaks >>> maven artifact id), clojure-lang (breaks build.xml). >> >> Not that I have a strong stake in this, but I'd vote for going with >> "clojure" and getting it right for 1.0. > > Right. It's easier to change this pom before it goes into the public > repo than after. When people are going to change their pom from some > odd snapshot to 1.0 anyway, then this is probably a good time to sneak > this artifactId change in too, no? I agree with your position. So, along with uploading the bundle to Central, I'll provide a patch to reflect pom changes in SVN. I'm going to push the bundle forward during the weekend. -Stefan --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Clojure Community Geography (The Clojure Map)
A self-selected group of about 110 Clojure users have noted their locations on this google map: http://tinyurl.com/clojure-map ( to preview the full URL before visiting: http://preview.tinyurl.com/clojure-map ) Map Info: Clojure 17,533 views - Public Created on Oct 17, 2008 - Updated Apr 11 By Graham Fawcett - Open Collaboration Rated 5 out of 5 2 ratings If you'd like to add your marker to the list: - open the URL - sign in to Google - at the upper right of the pane on the left that lists all the names, click "edit" - on the map, at the upper left, click the blue marker icon - place the marker and edit the info - save Thanks, Graham! --Steve smime.p7s Description: S/MIME cryptographic signature
Re: anyone else think (take) is backwards?
take, drop, take-while and drop-while, exactly mirror the definitions in the Haskell Prelude, FWIW (except for the non-camel-case names) This order makes sense if you're into currying: user=> (let [f (partial take 3)] (f (range 2))) (0 1 2) Tom On May 6, 7:09 pm, e wrote: > (take) makes perfect sense the way it is, but it doesn't seem > consistent with other similar things in that many things take the > collection, first. > > consider (get), (nth), and how java interop looks. The pattern seems > to be: "(function thing argument)" ... except for (take) -- and maybe > other cases? --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
Laurent PETIT writes: > I also think it makes sense to deposit the whole "battery" : > clojureXX.jar > clojure-slimXX.jar > clojure-sourcesXX.jar Since clojure-slim is not bundled in the distributed ZIP for 1.0.0, I'm going the build all three libraries from SVN tag "1.0" (r1365). I've figured, though, that the resulting libraries contain class files, which are of different size than those found in the distributed clojure-1.0.0.jar. How can this actually happen? Is this problematic? My build environment was Debian squeeze, SUN J2SE 1.6.0_13, Ant 1.7.0, OS character encoding UTF-8. Eventhough I do not have an explanation for the different build results, building from a fresh /svn/tags/1.0 should be OK, shouldn't it? -Stefan --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?
2009/5/8 Stefan Hübner > > Laurent PETIT writes: > > > I also think it makes sense to deposit the whole "battery" : > > clojureXX.jar > > clojure-slimXX.jar > > clojure-sourcesXX.jar > > Since clojure-slim is not bundled in the distributed ZIP for 1.0.0, I'm > going the build all three libraries from SVN tag "1.0" (r1365). svn tag 1.0 is correct, it's a copy of branch 1.0 in revision 1362 . > > I've figured, though, that the resulting libraries contain class files, > which are of different size than those found in the distributed > clojure-1.0.0.jar. How can this actually happen? Is this problematic? > My build environment was Debian squeeze, SUN J2SE 1.6.0_13, Ant 1.7.0, > OS character encoding UTF-8. note that clojure must be compatible with JDK 1.5, so if you compile with 1.6, maybe you should verify the compatibility mode (not sure if what I write here makes sense, I'm not a specialist in javac retrocompatibility concerns). > > > Eventhough I do not have an explanation for the different build results, > building from a fresh /svn/tags/1.0 should be OK, shouldn't it? > > -Stefan > > > > > --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Can "for" be enhanced to not have to take a binding?
Hi, This `lazy-seq` over a `when` and `cons` idiom seems fairly common. Is there any reason there is not a function for it? For example: (defn cons-while "Lazily creates a sequence by repeatedly calling f until pred is false" [pred f] (lazy-seq (when pred (cons f (cons-while pred f) I haven't tested it but I suspect the following should now work: (cons-while (Mouse/hasEvent) (Mouse/getEvent)) Regards, Mark -- http://mark.reid.name On May 8, 7:44 am, Meikel Brandmeyer wrote: > Hi, > > lazy-seq to the rescue: > > (defn mouse-seq > [] > (lazy-seq > (when (Mouse/hasEvent) > (cons (Mouse/getEvent) (mouse-seq) > > Sincerely > Meikel > > Am 07.05.2009 um 23:40 schrieb CuppoJava: > > > > > > > Yeah (pred) is not supposed to depend on any items inside f. > > > This is why (take-while pred (repeatedly f))) > > won't work in this situation. > > > (take-while) will always take an element out of f, so that it can be > > tested using (pred). I don't want any elements of (f) to be looked at > > if (pred) is false. > > > USE CASE > > I'm using it in combination with some Java libraries. The following > > seems like a very clojure-ish way of doing things. > > > (for [:while (Mouse/hasEvent)] (Mouse/getEvent)) > > > so this returns a nice lazy stream of mouse events, which can be > > processed however i like. > > > > > > smime.p7s > 5KViewDownload --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Clojure Community Geography (The Clojure Map)
Added to the map ;-) On Fri, May 8, 2009 at 10:22 AM, Stephen C. Gilardi wrote: > A self-selected group of about 110 Clojure users have noted their > locations on this google map: > >http://tinyurl.com/clojure-map > --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Yet Another Swing Example
Hello, I've posted an example of a simple model-view-controller GUI skeleton in Clojure here: http://lifeofaprogrammergeek.blogspot.com/2009/05/model-view-controller-gui-in-clojure.html The GUI has a text box and a panel which draws what you type. It's not much, but I learned a lot doing it, and thought perhaps others could benefit from seeing it. The add-watch function is so cool! There's probably lots of room for improvement, I would appreciate any recommendations. I've started looking at neman.cells, but don't really understand it yet. Might using cells simplify this code? Best, Curran Here's the code: ;A test program exploring how to structure GUI code in Clojure ;The GUI draws whatever you type in the text field nicely in the panel below. ;license: Public domain (import '(javax.swing JFrame JLabel JTextField JButton JPanel) '(java.awt.event ActionListener) '(java.awt GridBagLayout GridBagConstraints Color Font RenderingHints)) (defn make-model [] (ref "Hello MVC!")) (defn make-graphics-panel [model] (let [panel (proxy [JPanel] [] (JPanel [] (println "in constructor")) (paint [g] (doto g ;clear the background (.setColor (. Color black)) (.fillRect 0 0 (.getWidth this) (.getHeight this)) ;draw the text (.setRenderingHint (. RenderingHints KEY_ANTIALIASING) (. RenderingHints VALUE_ANTIALIAS_ON)) (.setFont (Font. "Serif" (. Font PLAIN) 40)) (.setColor (. Color white)) (.drawString @model 20 40] ;repaint when the model changes (add-watch model "repaint" (fn [k r o n] (.repaint panel))) panel)) (defn make-text-field [model] (doto (JTextField.) (.setText @model) (.addActionListener (proxy [ActionListener] [] (actionPerformed [e] (let [new-text (.getActionCommand e)] (dosync (ref-set model new-text (defn make-gui-panel [model] (defn make-text-field-constraints [] (let [c (GridBagConstraints.)] (set! (.fill c) (. GridBagConstraints HORIZONTAL)) (set! (.weightx c) 1) c)) (defn make-panel-constraints [] (let [c (GridBagConstraints.)] (set! (.gridy c) 1) (set! (.weighty c) 1) (set! (.fill c) (. GridBagConstraints BOTH)) c)) (let [gridbag (GridBagLayout.) text-field (make-text-field model) panel (make-graphics-panel model)] ;set up the gridbag constraints (doto gridbag (.setConstraints text-field (make-text-field-constraints)) (.setConstraints panel (make-panel-constraints))) ;add the components to the panel and return it (doto (JPanel.) (.setLayout gridbag) (.add text-field) (.add panel (defn show-in-frame [panel width height frame-title] (doto (JFrame. frame-title) (.add panel) (.setSize width height) (.setVisible true))) (show-in-frame (make-gui-panel (make-model)) 300 110 "GUI Test") --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: The Santa Claus Problem
On Wed, May 6, 2009 at 12:38 AM, bOR_ wrote: > If i remember correctly, any agents send (or send-off?) within a > dosync are only send off after the dosync completed. Yes, that's the kind of semantics I want, but it would be rather clunky to have to set up an agent and fake a transformation of its contents just to get a side effect (such as i/o) to be properly delayed until after the transaction is completed. That's why I proposed something like: (after-commit (println "Done committing")) --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Can "for" be enhanced to not have to take a binding?
Hi, 2009/5/8 Mark Reid > > Hi, > > This `lazy-seq` over a `when` and `cons` idiom seems fairly common. Is > there any reason there is not a function for it? For example: > > (defn cons-while > "Lazily creates a sequence by repeatedly calling f until pred is > false" s/false/logical false/ > > [pred f] > (lazy-seq >(when pred > (cons f (cons-while pred f) > > I haven't tested it but I suspect the following should now work: > > (cons-while (Mouse/hasEvent) (Mouse/getEvent)) (cons-while #(Mouse/hasEvent) #(Mouse/getEvent)) or maybe create a general version of repeatedly-while : (defn repeatedly-while [pred f] (take-while pred (repeatedly f))) and call it like this also: (repeatedly-while #(Mouse/hasEvent) #(Mouse/getEvent)) Then I remark it is just a minor variation on Meikel's first answer : (take-while #(no-op-pred) (repeatedly f))) (not tested) > > Regards, > > Mark > -- > http://mark.reid.name > > On May 8, 7:44 am, Meikel Brandmeyer wrote: > > Hi, > > > > lazy-seq to the rescue: > > > > (defn mouse-seq > >[] > >(lazy-seq > > (when (Mouse/hasEvent) > >(cons (Mouse/getEvent) (mouse-seq) > > > > Sincerely > > Meikel > > > > Am 07.05.2009 um 23:40 schrieb CuppoJava: > > > > > > > > > > > > > Yeah (pred) is not supposed to depend on any items inside f. > > > > > This is why (take-while pred (repeatedly f))) > > > won't work in this situation. > > > > > (take-while) will always take an element out of f, so that it can be > > > tested using (pred). I don't want any elements of (f) to be looked at > > > if (pred) is false. > > > > > USE CASE > > > I'm using it in combination with some Java libraries. The following > > > seems like a very clojure-ish way of doing things. > > > > > (for [:while (Mouse/hasEvent)] (Mouse/getEvent)) > > > > > so this returns a nice lazy stream of mouse events, which can be > > > processed however i like. > > > > > > > > > > smime.p7s > > 5KViewDownload > > > > --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---