[ANN] Documentation generator - Receipt Receipt Plugin

2013-11-03 Thread Kelker Ryan
Receipt Receipt PluginStandalone and plugin Clojure documentation generator.Standalone [receipt "1.0.1"]Lein Plugin [receipt-plugin "1.0.1"]Usage DocumentationThe documentation for receipt was generated with receipt and can be viewed here$ lein receipt-plugin Writing doc/receipt.core.html

Re: [ANN] Documentation generator - Receipt Receipt Plugin

2013-11-03 Thread Kelker Ryan
Here's the source on Github https://github.com/runexec/receipt-clj  03.11.2013, 17:08, "Kelker Ryan" theinter...@yandex.com:Receipt Receipt PluginStandalone and plugin Clojure documentation generator.Standalone [receipt "1.0.1"]Lein Plugin [receipt-plugin "1.0.1"]Usage DocumentationThe

[ANN] Imagez 0.2.0

2013-11-03 Thread Mikera
Hi All, I made some updates to my lightweight Clojure bitmap image processing library. - https://github.com/mikera/imagezhttps://github.com/mikera/imagez/tree/develop Builds available from clojars here: - https://clojars.org/net.mikera/imagez Main interesting addition is the addition of a

Re: Functions using locks are slowed even when locks are never taken

2013-11-03 Thread shlomivaknin
same results on my machine as well. I tried decompiling the jar (with cider-decompile), and the parts that actually run (the then clause) seems almost identical. If you'r interested, i can post them later tonight. On Sunday, November 3, 2013 2:32:42 AM UTC+2, Michael Blume wrote: Hmm, it

Re: assoc / dissoc consistency, maps and vectors

2013-11-03 Thread Jozef Wagner
You also assume keys are comparable or that 'conj order' is retained, which is often not true. Consider following map: (your-dissoc {2 1, :a 1, foo 1, 'bar 1} 2) = Vectors are indexed and maps are associative. These two concepts share some functionalities (assoc, get), but are otherwise

Re: Scala interop (or, aliasing imported Java classes)

2013-11-03 Thread Marshall Bockrath-Vandegrift
Mark mjt0...@gmail.com writes: I think my preferred solution would be to allow imported Java classes to be aliased, so I could do this: (import '(org.fooinstitute.team.library.foo package :as foop)) = org.fooinstitute.team.library.foo.package (foop/isFoo foop) = false But to the best of

Re: What's the -dup in print-dup?

2013-11-03 Thread Marshall Bockrath-Vandegrift
John Mastro john.b.mas...@gmail.com writes: This isn't a very deep question, but I wonder every time I come across it: to what does -dup in `print-dup` and `*print-dup*` refer? I don’t have any special knowledge in this regard, but I’ve always thought of it as “duplicate,” which makes some

Re: Functions using locks are slowed even when locks are never taken

2013-11-03 Thread Michał Marczyk
You have a typo in foo -- monitor-exit's argument is 0 (zero) rather than o (the sentinel object). Besides that, in foo both monitor-enter and monitor-exit get their arguments from a Var. Rewriting to use locking, which first puts the object whose monitor will be used in a local (that is, (let

Re: Functions using locks are slowed even when locks are never taken

2013-11-03 Thread Michał Marczyk
I should perhaps make clear that with direct use of monitor-enter and monitor-exit with a Var it's possible for monitor-enter and monitor-exit to operate on different objects even in the absence of typos, namely if somebody rebinds the Var. To illustrate this with print at the REPL (a regular

Re: Functions using locks are slowed even when locks are never taken

2013-11-03 Thread Andy Fingerhut
Good detective work, Michal. So the extra time for the slower version was because a Var was always being accessed in the generated byte code, even if the source code was only explicitly accessing the Var in a branch that was never executed? Thanks, Andy On Sun, Nov 3, 2013 at 9:30 AM, Michał

Re: Functions using locks are slowed even when locks are never taken

2013-11-03 Thread Michael Blume
Huh, interesting. I have: (defn foo' [x] (if ( x 0) (inc x) (let [res (locking o (dec x))] res))) (defn foo'' [x] (if ( x 0) (inc x) (locking o (dec x foo' is fast, but foo'' is slow. So something about wrapping the locking clause in a let makes it fast. Still no

Re: Scala interop (or, aliasing imported Java classes)

2013-11-03 Thread Sean Corfield
Perhaps a small extension to (import ..) is warranted then, since the underlying machinery seems to support aliases? (import [the.java.package {Clazz1 Alias1 Clazz2 Alias2} Clazz3]) or, maybe more in keeping with require: (import [the.java.package Clazz1 Clazz2 Clazz3 :rename {Clazz1

Re: Scala interop (or, aliasing imported Java classes)

2013-11-03 Thread Sean Corfield
That would need quoting wouldn't it? (import '(the.java.package {Clazz1 Alias1 Clazz2 Alias2} Clazz3)) or: (import '(the.java.package Clazz1 Clazz2 Clazz3 :rename {Clazz1 Alias1 Clazz2 Alias2})) On Sun, Nov 3, 2013 at 11:22 AM, Sean Corfield seancorfi...@gmail.com wrote: Perhaps a

Re: Functions using locks are slowed even when locks are never taken

2013-11-03 Thread Michael Blume
I mean, I'm probably being naive, but this suggests that one could write (defmacro locking' [ forms] `(let [res# (locking ~@forms)] res#)) and use locking' in place of locking for improved performance. Is this wrong? If it's right, does that suggest the macro in clojure.core should be changed?

Re: Functions using locks are slowed even when locks are never taken

2013-11-03 Thread Michał Marczyk
Well, that is interesting. The difference between the compiled versions of (defn foo [x] (if ( x 0) (inc x) (locking o (dec x and (defn bar [x] (if ( x 0) (inc x) (let [res (locking o (dec x))] res))) is quite significant. foo gets compiled

Re: Potential improvement to select-keys ?

2013-11-03 Thread Don Jackson
On Nov 2, 2013, at 9:27 AM, Mark Engelberg mark.engelb...@gmail.com wrote: I seem to be a relatively lone voice thinking it makes sense to preserve the type of the map, and honestly, I'm not going to lose any sleep if this patch is never actually implemented, but here's my two cents on the

Why is this count example not working: (count % '(1 2 3))

2013-11-03 Thread Angus
(count % '(1 2 3)) I am getting error: clojure.lang.ArityException: Wrong number of args (2) passed to: core$count -- -- 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

Re: Why is this count example not working: (count % '(1 2 3))

2013-11-03 Thread Joseph Smith
% is used as the implicit arg in the #() (syntactic sugar) anonymous function form. Maybe you want (count '(1 2 3)). --- Joseph Smith j...@uwcreations.com @solussd On Nov 3, 2013, at 3:39 PM, Angus anguscom...@gmail.com wrote: (count % '(1 2 3)) I am getting error:

Re: Why is this count example not working: (count % '(1 2 3))

2013-11-03 Thread Alan Forrester
On 3 Nov 2013, at 21:39, Angus anguscom...@gmail.com wrote: (count % '(1 2 3)) I am getting error: clojure.lang.ArityException: Wrong number of args (2) passed to: core$count http://clojuredocs.org/clojure_core/clojure.core/count Count only takes one argument, a collection, and returns

tomcat 6/7 stream closed error in ring json - works in lein ring server

2013-11-03 Thread Colin Yates
Hi all, I have developed a ring/compojure app which receives and servers JSON. All is well in 'lein ring server' but as soon as I do 'lein ring uberwar' and deploy it to tomcat 6 or 7 it fails. To be explicit, the app deploys and I can view the static resources, but as soon as I issue a JSON

Re: tomcat 6/7 stream closed error in ring json - works in lein ring server

2013-11-03 Thread Colin Yates
Apologies - I just realised a Compojure group existed. I have posted in there (https://groups.google.com/forum/#!topic/compojure/_jut36dXmCM) as well. On Monday, 4 November 2013 00:20:29 UTC, Colin Yates wrote: Hi all, I have developed a ring/compojure app which receives and servers JSON.

Re: tomcat 6/7 stream closed error in ring json - works in lein ring server

2013-11-03 Thread James Reeves
Hi Colin, One of the compromises Ring makes for efficiency is that the body of a request is an InputStream, rather than a static string or byte array pre-loaded into memory. Because it's a stream, it can potentially be consumed by previous middleware. For some reason you have both wrap-json-body

Re: tomcat 6/7 stream closed error in ring json - works in lein ring server

2013-11-03 Thread Colin Yates
Hi James, Not sure why I did that double wrapping.. However, wouldn't that also fail in Jetty? On 4 November 2013 01:02, James Reeves ja...@booleanknot.com wrote: Hi Colin, One of the compromises Ring makes for efficiency is that the body of a request is an InputStream, rather than a

Re: [ANN] Jig

2013-11-03 Thread Timothy Washington
Ok, some more feedback for Jig. *A)* Testing - Let's say I have a multi-project jig, with dependencies across projects. There doesn't seem to be a way to run tests (midje :autotest) for a specific project. I tried creating a Midje component (see https://www.refheap.com/20442). But when I *i)* put

New Functional Programming Job Opportunities

2013-11-03 Thread Functional Jobs
Here are some functional programming job opportunities that were posted recently: Senior Clojure Software Engineer at DRW Trading Group http://functionaljobs.com/jobs/8653-senior-clojure-software-engineer-at-drw-trading-group Cheers, Sean Murphy FunctionalJobs.com -- -- You received