First foray into profiling

2011-01-09 Thread Mark Engelberg
I'm trying to use JVisualVM to profile some Clojure code. One thing I successfully figured out from using the profiler was that lein swank was not actually starting the jvm in -server mode like I thought it was. Arggh, now I have to figure out what's going wrong there. In the meantime, I fired

Re: Oddity: PersistentTreeMap does not implement SortedMap

2011-01-09 Thread Stuart Halloway
No, they should: http://dev.clojure.org/jira/browse/CLJ-705 Stu I notice that clojure.lang.PersistentTreeMap does not implement SortedMap (let alone NavigableMap), unlike java.util.TreeMap. Any particular reason why? -- You received this message because you are subscribed to the Google

Re: How to test for literal

2011-01-09 Thread Stuart Halloway
Basically, I want the clojure equivalent of a clisp atom. In clisp, atom is true for everything that is not a cons cell. The closest match I found is creating a macro that returns true for everything that is not a list: clisp: (atom 1) = true (atom '(1 2 3)) = false I hope that makes

Re: Oddity: PersistentTreeMap does not implement SortedMap

2011-01-09 Thread bOR_
(type (sorted-map-by 3 1 2 4 5 3)) clojure.lang.PersistentTreeMap user (type (select-keys (sorted-map-by 3 1

Re: First foray into profiling

2011-01-09 Thread Albert Cardona
2011/1/9 Mark Engelberg mark.engelb...@gmail.com: I'm trying to use JVisualVM to profile some Clojure code. One thing I successfully figured out from using the profiler was that lein swank was not actually starting the jvm in -server mode like I thought it was.  Arggh, now I have to figure

Re: First foray into profiling

2011-01-09 Thread John
Hm I've used JVisualVM before but not in cojunction with lein swank. On my machine it appears to start two clojure.main processes both on the client jvm, and referencing the clojure 1.2 jar despite having one of the 1.3 versions in project.clj. Hrm.. On Jan 9, 6:15 am, Mark Engelberg

Re: Oddity: PersistentTreeMap does not implement SortedMap

2011-01-09 Thread Michael Wood
On 9 January 2011 16:23, bOR_ boris.sch...@gmail.com wrote: (type (sorted-map-by 3 1 2 4 5 3)) clojure.lang.PersistentTreeMap user (type (select-keys (sorted-map-by 3 1 2 4 5 3) (list 5 2 3))) clojure.lang.PersistentArrayMap Not sure if this is related in any way but the topic of

Entity component system

2011-01-09 Thread msappler
Hey for the lasts 6 months I am developing an action RPG game in clojure (and learning the language). For this game I developed an entity component system which is a way of using composition to create entities in the game. I also use slick2d for the 2d engine. Here I posted some examples for

Library and development process for GAE

2011-01-09 Thread Stefan Kamphausen
Hi, finally I find some time to dive into the development with Clojure for Googles AppEngine. My first question is: which library should a newcomer use, appengine[1] or appengine-magic[2]? Or can you give me some hints in which way they differ? They both seem to be actively developed. And

Re: Clojure job scheduler

2011-01-09 Thread Patrik Fredriksson
I have used cron4j in a small project, it's like a more lightweight version of Quartz and fits nicely with Clojure: http://www.sauronsoftware.it/projects/cron4j/ Code example here: https://gist.github.com/388555 /Patrik On Jan 8, 8:37 pm, Trevor tcr1...@gmail.com wrote: Thanks, everyone for

Re: Library and development process for GAE

2011-01-09 Thread Constantine Vetoshev
On Jan 9, 10:54 am, Stefan Kamphausen ska2...@googlemail.com wrote: Given that decision I'd like to understand the general development process.   Does one always compile to a class (ns ...gen-class ..extends ..Servlet) and will the appengine development server pick up the changes, or will I

Re: Library and development process for GAE

2011-01-09 Thread Stefan Kamphausen
Hi, On Sunday, January 9, 2011 6:37:58 PM UTC+1, Constantine Vetoshev wrote: I'm the author of appengine-magic, so my opinion is necessarily biased in its favor. :) fine with me. The authors are most likely to be the ones to be able to tell the differences. :-) I optimized the

Re: how do I improve indentation of reify methods in clojure-mode

2011-01-09 Thread Eric Schulte
Hi, Even using Phil's clojure-mode I find myself often editing the source code of clojure-mode to add custom indentation or fontification for my own macros or for forms I feel have been missed. Perhaps some of the lists of function/marco-names in clojure-mode could be tucked behind

Re: First foray into profiling

2011-01-09 Thread Mark Engelberg
On Sun, Jan 9, 2011 at 3:15 AM, Mark Engelberg mark.engelb...@gmail.com wrote: In the meantime, I fired up the lein repl which did start up in -server mode, and tried to do some profiling.  It tells me 80% of its time is being spent in:

Re: First foray into profiling

2011-01-09 Thread Praki Prakash
It is most likely the transport used between your profiler front-end and the JVM backend. Right click on the entry point you are interested in and display it as a subtree. VisualVM and YourKit profilers show time percentages based on the time spent in that method which is want you want to see.

which IDEs are you all using?

2011-01-09 Thread Alex Baranosky
Hi, I'm most used to using Intellij, since it is what I use everyday at work programming in Java. So my first forays into Clojure have been using LaClojure. Some things I like about using Intellij for Clojure development are: - I can click on a piece of code and have Intellij take me to the

Re: which IDEs are you all using?

2011-01-09 Thread Vagif Verdi
Jumping to the definition of function: Alt-. Returning back Alt-, All other (and much more) features are implemented in slime (emacs package). On Jan 9, 11:01 am, Alex Baranosky alexander.barano...@gmail.com wrote: Hi, I'm most used to using Intellij, since it is what I use everyday at work

Re: Clojure job scheduler

2011-01-09 Thread Trevor
That works it's really easy to use - Thanks. On Jan 9, 9:22 am, Patrik Fredriksson patri...@gmail.com wrote: I have used cron4j in a small project, it's like a more lightweight version of Quartz and fits nicely with Clojure:http://www.sauronsoftware.it/projects/cron4j/ Code example

Metadata on symbols differ with caret reader

2011-01-09 Thread mdzaebel
Hi, (meta ^:k []) -- {:tag :k} (meta ^:k 'o) -- nil (meta(with-meta 'o {:tag :k})) -- {:tag :v} Why doesn't the second line return the metadata? Thanks, Marc Using Clj 1.2 -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

only 3 benchmarks game tasks still have no Clojure programs

2011-01-09 Thread Isaac Gouy
Only 3 tasks on the computer language benchmarks game still have no Clojure programs - 1) meteor-contest http://shootout.alioth.debian.org/u32q/benchmark.php?test=meteor 2) chameneos-redux http://shootout.alioth.debian.org/u32q/benchmark.php?test=chameneosredux 3) pidigits

Re: feedback on first compojure app: Sportello

2011-01-09 Thread Alex Baranosky
Thanks for the help James, I appreciate the points for improvement. I'll look into lein ring as soon as I can. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new

Re: Metadata on symbols differ with caret reader

2011-01-09 Thread Meikel Brandmeyer
Hi, Am 09.01.2011 um 22:52 schrieb mdzaebel: (meta ^:k []) -- {:tag :k} (meta ^:k 'o) -- nil (meta(with-meta 'o {:tag :k})) -- {:tag :v} Why doesn't the second line return the metadata? Because 'o expands to (quote o) and you actually hint this list. You might try (meta ' ^:k o).

Re: Metadata on symbols differ with caret reader

2011-01-09 Thread Tim Robinson
You must have something messed up: In line 1 (meta ^:k []) does not return {:tag :k} it returns nil and I am using Clojure 1.2. Both lines 1 and 2, shouldn't return meta, because 'meta' only takes an object as an input argument. And only if the object already has metadata will metadata will

Re: Metadata on symbols differ with caret reader

2011-01-09 Thread Meikel Brandmeyer
Hi, Am 10.01.2011 um 01:10 schrieb Tim Robinson: You must have something messed up: In line 1 (meta ^:k []) does not return {:tag :k} it returns nil and I am using Clojure 1.2. Both lines 1 and 2, shouldn't return meta, because 'meta' only takes an object as an input argument. And

Re: Metadata on symbols differ with caret reader

2011-01-09 Thread Tim Robinson
Am I sure?.. No, I'm never sure :) But I am using 1.2 and when I run (meta ^:k []) or even (meta '^:k o) I get nil. Plus: app= (doc meta) - clojure.core/meta ([obj]) Returns the metadata of obj, returns nil if there is no metadata. nil I could be missing something?

Re: Entity component system

2011-01-09 Thread justinhj
Thanks for sharing. I've also spent some time building a Common Lisp game engine that uses a component architecture for the game objects. For example in pong the player's paddle is made up of a visual, physical and logical components. (defun make-pong-player(side human sprite-def control-type

Re: which IDEs are you all using?

2011-01-09 Thread jeregrine
I've been using Vim, screen, and lein repl. I definitely don't use it efficiently but its a start. If anyone knows a good vim clojure tutorial I will be all ears. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: which IDEs are you all using?

2011-01-09 Thread gaz jones
i wrote this recently about how i edit clojure in emacs, listing some features i find especially useful: http://blog.gaz-jones.com/post/2501842155/interactive-clojure-development-in-emacs-with-leiningen i used to use vimclojure as vim was my favourite editor but decided to take the plunge and

Re: Clojure Quizzes?

2011-01-09 Thread John Svazic
Thanks Sean and Benjamin. I've started at Coderloop and I must admit that I'm hooked. I'll take a look at Project Euler next, once I'm done providing suggestions and finishing a few more quizzes at Coderloop. :-) Now I'll have to hit the IRC channel to get help on some minor issues so as not

Re: Metadata on symbols differ with caret reader

2011-01-09 Thread Tim Robinson
user= (meta '^:k o) {:tag :k} How does this happen when :tag is not even in the expression? If you launch a brand new repl and run it what happens? On Jan 9, 5:17 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 10.01.2011 um 01:10 schrieb Tim Robinson: You must have something messed up:

Re: Library and development process for GAE

2011-01-09 Thread Glen Stampoultzis
On 10 January 2011 04:37, Constantine Vetoshev gepar...@gmail.com wrote: On Jan 9, 10:54 am, Stefan Kamphausen ska2...@googlemail.com wrote: Given that decision I'd like to understand the general development process. Does one always compile to a class (ns ...gen-class ..extends ..Servlet)

Re: which IDEs are you all using?

2011-01-09 Thread Alex Baranosky
Thanks for showing your blog entry. It's coming in handy. Alex -- 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

Re: which IDEs are you all using?

2011-01-09 Thread Alex Baranosky
Hi Gaz, I followed your blog and when I used Emacs to install the package syou suggested (clojure-mode, slime etc) I go this error output. I'd love to know if this means anything to anyone, I'm a total newbie to Emacs: Compiling file

Re: which IDEs are you all using?

2011-01-09 Thread gaz jones
hey, did it fail to install or was it just a warning? you can check if it installed with M-x package-list-packages and seeing if it is in the installed list (should be at the bottom of the buffer marked as installed). you get quite a lot of warnings with some of those packages on install but

Re: which IDEs are you all using?

2011-01-09 Thread Alex Baranosky
After a little fiddling I see that of the 5 (clojure-mode, clojure-test-mode, slime, slime-repl, swank-clojure) all installed, except clojure-test did not (it's not red) Now when I try to install that package it says that the file, clojure-mode.el, exists already. Yea, clojure mode is installed,

Re: Metadata on symbols differ with caret reader

2011-01-09 Thread Meikel Brandmeyer
Hi, On 10 Jan., 04:17, Tim Robinson tim.blacks...@gmail.com wrote: How does this happen when :tag is not even in the expression? If you launch a brand new repl and run it what happens? What I posted in the previous email is exactly a fresh repl session and what happens there with 1.2. And in