Re: aot compilation: minimise the scope of the resulting classes

2012-05-23 Thread Philip Aston
On Tuesday, May 22, 2012 6:06:21 PM UTC+1, Hugo Duncan wrote:

 Phil Hagelberg writes: 
  One solution is to call require at runtime inside function bodies 
  rather than at the top-level. Then to call the functions from the 
  runtime-required namespace, use the resolve function. 

 Another is to use :impl-ns option in genclass and implement the java class 
 in a separate 
 namespace (assuming you are using genclass). 


Thank you both for the rapid assistance.

- 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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

[ANN] Carmine, a new Redis client for Clojure

2012-05-23 Thread Peter Taoussanis
Hi all!

Quick announcement: I've been working on bringing together the best 
features from the current crop of Clojure Redis clients, and filling in 
some of the remaining holes.

It's on GitHub (https://github.com/ptaoussanis/carmine) and Clojars (
http://clojars.org/carmine).

Since I'm NOT using it in production anywhere yet, I'd caution anyone to 
treat it as still experimental for now. The goal, however, is to head 
toward something very much production-ready by the time 1.0 rolls around.

Features (taken from the readme):
* A high-performance, all-Clojure client.
* Modern targets: Redis 2.0+ (with full 2.6 support), Clojure 1.3+, 
Leiningen 2.
* Connection pooling.
* Complete and accurate command definitions with full documentation.
* Composable, first-class command functions.
* Flexible, high-performance binary-safe serialization.
* Full support for Lua scripting, Pub/Sub, etc.
* Command helpers (sort*, etc.).

Any comments/pull-requests/whatever very welcome!

- Peter Taoussanis (@ptaoussanis)

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Carmine, a new Redis client for Clojure

2012-05-23 Thread Baishampayan Ghose
Peter,

I looked at the code briefly, and it's quite impressive!

I might pick up Carmine for use in our project.

Thanks,
BG

On Wed, May 23, 2012 at 2:41 PM, Peter Taoussanis ptaoussa...@gmail.com wrote:
 Hi all!

 Quick announcement: I've been working on bringing together the best features
 from the current crop of Clojure Redis clients, and filling in some of the
 remaining holes.

 It's on GitHub (https://github.com/ptaoussanis/carmine) and Clojars
 (http://clojars.org/carmine).

 Since I'm NOT using it in production anywhere yet, I'd caution anyone to
 treat it as still experimental for now. The goal, however, is to head
 toward something very much production-ready by the time 1.0 rolls around.

 Features (taken from the readme):
 * A high-performance, all-Clojure client.
 * Modern targets: Redis 2.0+ (with full 2.6 support), Clojure 1.3+,
 Leiningen 2.
 * Connection pooling.
 * Complete and accurate command definitions with full documentation.
 * Composable, first-class command functions.
 * Flexible, high-performance binary-safe serialization.
 * Full support for Lua scripting, Pub/Sub, etc.
 * Command helpers (sort*, etc.).

 Any comments/pull-requests/whatever very welcome!

 - Peter Taoussanis (@ptaoussanis)

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



-- 
Baishampayan Ghose
b.ghose at gmail.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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN Welle 1.0 final

2012-05-23 Thread Peter Taoussanis
Looks great - well done! I passed over Riak a while back because of the 
lack of a good client- might be time to take a real look at it again.

Love the ClojureWerkz pages btw.

- Peter Taoussanis

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ANN Welle 1.0 final

2012-05-23 Thread László Török
On May 23, 2012 11:35 AM, Peter Taoussanis ptaoussa...@gmail.com wrote:

 Looks great - well done! I passed over Riak a while back because of the
lack of a good client- might be time to take a real look at it again.

 Love the ClojureWerkz pages btw.
+1

 - Peter Taoussanis

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Submitting patches - git format-patch and git diff

2012-05-23 Thread Dave Sann
Not directly clojure related - but input needed

I have master
I have mybranch

I have a bunch of commits on mybranch.

I can create an attributed patch with git format-patch master. This 
includes all commits on the branch, including merges and updates from 
master.
I can create an unattributed but more concise diff with git diff master. 

I don't think that all of the commits on mybranch are particularly relevant 
- more steps on the way to the solution - only the final diff really 
matters.

Questions:

- is it preferred to have all commits from a branch?
  - even if it makes the patch harder to follow?
- if a diff is preferred - how do you create one that is attributed?

Thanks in advance

Dave



-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Submitting patches - git format-patch and git diff

2012-05-23 Thread Dave Sann
A good answer if anyone has this issue:

Having a clean history with complete/logical features is recommended.
However, in development branches we can make many small commits and
the history may not be clean. That's fine, as long as we clean the
history before merging into master.

This is where interactive rebase will help. More info here
http://git-scm.com/book/en/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages

thanks to Baishampayan Ghose



On Wednesday, 23 May 2012 19:57:37 UTC+10, Dave Sann wrote:

 Not directly clojure related - but input needed

 I have master
 I have mybranch

 I have a bunch of commits on mybranch.

 I can create an attributed patch with git format-patch master. This 
 includes all commits on the branch, including merges and updates from 
 master.
 I can create an unattributed but more concise diff with git diff master. 

 I don't think that all of the commits on mybranch are particularly 
 relevant - more steps on the way to the solution - only the final diff 
 really matters.

 Questions:

 - is it preferred to have all commits from a branch?
   - even if it makes the patch harder to follow?
 - if a diff is preferred - how do you create one that is attributed?

 Thanks in advance

 Dave





-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Submitting patches - git format-patch and git diff

2012-05-23 Thread Tassilo Horn
Dave Sann daves...@gmail.com writes:

 Having a clean history with complete/logical features is recommended.
 However, in development branches we can make many small commits and
 the history may not be clean. That's fine, as long as we clean the
 history before merging into master.

You can also try to keep your branch clean directly by not merging from
origin/master but rebasing your work on it:

  git pull vs. git pull --rebase

Bye,
Tassilo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


clojure jython interop

2012-05-23 Thread Brent Millare
Before I dive in to the literature, I was wondering if anyone had 
experiences worth sharing trying to call jython code from clojure?

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] clojure-echonest-api

2012-05-23 Thread Simone Mosciatti
Looking the code again I believe that I should use a future and not an 
agent...
I am right ???

Il giorno martedì 22 maggio 2012 16:10:58 UTC-5, Simone Mosciatti ha 
scritto:

 Hi everybody,

 I have release a library to query the echonest[1][2] API.
 This is my very first job so I'm looking for feedback, especially about 
 how to manage some basic configuration[3] and how introduce asynchronously 
 agent[4]...

 I am very happy to have finished this job...

 Please contact me for every question or just to say that i did everything 
 wrong...

 Simone Mosciatti

 [1] http://the.echonest.com/
 [2] http://developer.echonest.com/ 
 [3] Lines 16 and 18 
 https://github.com/siscia/echonest-clojure-api/blob/master/src/echonest_api/with-doc-core.clj#L16
 [4] Line 7 
 https://github.com/siscia/echonest-clojure-api/blob/master/src/echonest_api/with-doc-core.clj#L7


Il giorno martedì 22 maggio 2012 16:10:58 UTC-5, Simone Mosciatti ha 
scritto:

 Hi everybody,

 I have release a library to query the echonest[1][2] API.
 This is my very first job so I'm looking for feedback, especially about 
 how to manage some basic configuration[3] and how introduce asynchronously 
 agent[4]...

 I am very happy to have finished this job...

 Please contact me for every question or just to say that i did everything 
 wrong...

 Simone Mosciatti

 [1] http://the.echonest.com/
 [2] http://developer.echonest.com/ 
 [3] Lines 16 and 18 
 https://github.com/siscia/echonest-clojure-api/blob/master/src/echonest_api/with-doc-core.clj#L16
 [4] Line 7 
 https://github.com/siscia/echonest-clojure-api/blob/master/src/echonest_api/with-doc-core.clj#L7


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Midje 1.4 released

2012-05-23 Thread Brian Marick
Midje is a test framework for Clojure. It supports top-down as well as 
bottom-up testing, encourages readable tests, provides a smooth migration path 
from clojure.test, and supports a balance between abstraction and concreteness.

Special thanks to Alex Baranosky for all his work on this version.

Changes: https://github.com/marick/Midje/wiki/New-in-1.4
User documentation: https://github.com/marick/Midje/wiki 
Repo: https://github.com/marick/Midje

-
Brian Marick, Artisanal Labrador
Contract programming in Ruby and Clojure
Occasional consulting on Agile
www.exampler.com, www.twitter.com/marick

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


[ANN] Clojure JSR 223 Implementation

2012-05-23 Thread eduardoejp
Since the only other alternatives (http://code.google.com/p/clojure-jsr223/ 
and https://github.com/pmf/clojure-jsr223) seem pretty much dead, I decided 
to write my own (in Clojure).

You can get the jar downloading it from Clojars with lein dep and then just 
drop it in the desired class-path to have Clojure support.

Here's the link: http://clojars.org/clj-jsr223

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Unable to pass unboxed primitive to methods taking multiple numeric primitive types.

2012-05-23 Thread Cedric Greevey
(defn f [^java.awt.image.BufferedImage bi x]
  (.setSample (.getRaster bi) 0 0 0 (double x)))
#CompilerException java.lang.IllegalArgumentException: More than one
matching method found: setSample, compiling:(NO_SOURCE_PATH:1)

The only way I was able to find to fix this is

(defn f [^java.awt.image.BufferedImage bi]
  (.setSample (.getRaster bi) 0 0 0 ^Double (double x)))

which presumably forces x to be boxed and unboxed again.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] Clojure JSR 223 Implementation

2012-05-23 Thread Kevin Downey
you might want to use something like
https://github.com/flatland/classlojure or
https://github.com/hiredman/polycosm to provide an isolated clojure
runtime per instance of ClojureScriptEngine.

single segment namespaces are bad because the generate classes end up
in the default package.

checking jars in to git is bad form, github provides a downloads
feature if you want to host a downloadable jar there.

On Wed, May 23, 2012 at 4:56 PM, eduardoejp eduardo...@gmail.com wrote:
 Since the only other alternatives (http://code.google.com/p/clojure-jsr223/
 and https://github.com/pmf/clojure-jsr223) seem pretty much dead, I decided
 to write my own (in Clojure).

 You can get the jar downloading it from Clojars with lein dep and then just
 drop it in the desired class-path to have Clojure support.

 Here's the link: http://clojars.org/clj-jsr223

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] Clojure JSR 223 Implementation

2012-05-23 Thread eduardoejp
Thanks for the advice. I'll check into those.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Unable to pass unboxed primitive to methods taking multiple numeric primitive types.

2012-05-23 Thread Cedric Greevey
On Wed, May 23, 2012 at 10:21 PM, Armando Blancas abm221...@gmail.com wrote:
 Is this any better?

 user= (defn f [^java.awt.image.BufferedImage bi x]
   (.setData (.getRaster bi) 0 0 0 ^double x))
 #'user/f

Didn't have a repl handy? It's quick to check that it produces:

Reflection warning, NO_SOURCE_PATH:2 - call to setData can't be resolved.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Parallel doseq?

2012-05-23 Thread Cedric Greevey
For some reason, this doesn't actually seem to be executing in parallel:

(defmacro pdoseq
  Bindings as for for, but parallel execution as per pmap, pcalls,
pvalues; returns
   nil.
  [seq-exprs  body]
  `(do
 (doall
   (pmap identity
 (for ~seq-exprs (do ~@body)))
 nil)))

user= (pdoseq [i (range 10)] (println n))
0
1
2
3
4
5
6
7
8
9

Never any interleaving of output and if I give it a big CPU-bound job
to do for each integer it only saturates one core.

I thought it might be a chunked-seq issue, but:

user= (chunked-seq? (range 10))
false

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] clojure-echonest-api

2012-05-23 Thread Ulises
 Looking the code again I believe that I should use a future and not an
 agent...
 I am right ???

I would think so. AFAIK, the advice has always been if you need to do
some computation on another thread don't (ab)use agents, use futures.

Additionally, you have[1]:

(def #^{:dynamic true} *api-key* (atom N6E4NIOVYMTHNDM8J))

unless you're planning on setting the key to different values in
different threads (unlikely?) you don't need to use an atom there.

All I've said above could be completely wrong so be warned :)

U

[1] 
https://github.com/siscia/echonest-clojure-api/blob/master/src/echonest_api/with-doc-core.clj#L16

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en