Re: RC 16: Last chance to test against Clojure 1.5 before it ships

2013-02-14 Thread Tassilo Horn
Stuart Halloway stuart.hallo...@gmail.com writes: If you care about Clojure 1.5 compatibility for your codebase, please test it against RC 16 as soon as possible. My code using tons of protocols, some deftypes, and the new reducers here and there still compiles, runs, and all tests pass. That

:use an entire namespace full of protocols or stick with :require?

2013-02-14 Thread Jim foo.bar
I know that using a bare :use in the ns macro is generally frowned upon as it provides no hints about what is actually being used... However, I 've got 2 namespaces 'abstractions.clj' and 'concretions.clj'...concretions.clj will eventually use all the protocols defined in

Help on implementing a simple java (openNLP) EventStream interface

2013-02-14 Thread Joachim De Beule
Hi All, I want to turn a clojure sequence into an 'EventStream' java interface in clojure (see http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-maxent/index.html). Basically this is an object that implements next() and hasNext() methods. I know this can be done with

Re: Belgium Clojure Meetup

2013-02-14 Thread Joachim De Beule
Hi there, I might join if the event takes place in Ghent. grtz Op maandag 11 februari 2013 23:11:36 UTC+1 schreef Thomas Goossens het volgende: *With some fellow Belgian clojurians (Frederik De Bleserhttp://www.enigmeta.com/ Wim De Clerq) I’m planning to organise a Clojure meetup in

Re: :use an entire namespace full of protocols or stick with :require?

2013-02-14 Thread Dave Sann
I don't like :use because I can't tell where things come from. require :refer [...] is good is you don't want the prefix. On Friday, 15 February 2013 00:26:50 UTC+11, Jim foo.bar wrote: I know that using a bare :use in the ns macro is generally frowned upon as it provides no hints about

Re: Help on implementing a simple java (openNLP) EventStream interface

2013-02-14 Thread Ulises
How about having your methods access an atom provided in a closure like it's done here: http://kotka.de/blog/2010/03/proxy_gen-class_little_brother.html U On 14 February 2013 13:58, Joachim De Beule joachim.de.be...@gmail.comwrote: Hi All, I want to turn a clojure sequence into an

Re: Help on implementing a simple java (openNLP) EventStream interface

2013-02-14 Thread Joachim De Beule
Thanks! So you mean like this (assuming some function elt-event): (defn seq-event-stream [input-seq] (let [remaining (atom input-seq)] (proxy [EventStream] [] (next [] (let [current (first @remaining)] (swap! remaining rest) (elt-event

Re: Help on implementing a simple java (openNLP) EventStream interface

2013-02-14 Thread Ulises
Without testing or anything that looks reasonable enough. I'm sure that there are plenty caveats around infinite seqs, etc. though. On 14 February 2013 14:22, Joachim De Beule joachim.de.be...@gmail.comwrote: Thanks! So you mean like this (assuming some function elt-event): (defn

How to set the value of a static variable in a java factory class from clojure?

2013-02-14 Thread Joachim De Beule
Hi All, I know how to call static java methods such as the ones defined here: http://grepcode.com/file/repo1.maven.org/maven2/org.apache.opennlp/opennlp-maxent/3.0.2-incubating/opennlp/maxent/GIS.java, e.g. trainModel(...). However, before I call this method I want to change the value of

Re: How to set the value of a static variable in a java factory class from clojure?

2013-02-14 Thread Baishampayan Ghose
Haven't looked at the code, but `set!` should work. ~BG Sent from phone. Please excuse brevity. On 14 Feb 2013 21:30, Joachim De Beule joachim.de.be...@gmail.com wrote: Hi All, I know how to call static java methods such as the ones defined here:

Re: how to automatically and idiomatically add newlines to clojure code in emacs

2013-02-14 Thread Mayank Jain
@Feng It doesn't clean up the way John is looking to clean some code like this: (defun func1 [a b c d] (func5 (let [f (func3 c)] (func2 a b f)) (let [e 5] (func4 c d e On Tue, Feb 12, 2013 at 9:11 AM, Feng Shen shen...@gmail.com wrote: (defun indent-buffer () (interactive)

Re: how to automatically and idiomatically add newlines to clojure code in emacs

2013-02-14 Thread Moritz Ulrich
C-u M-x indent-pp-sexp On Thu, Feb 14, 2013 at 6:06 PM, Mayank Jain firesof...@gmail.com wrote: @Feng It doesn't clean up the way John is looking to clean some code like this: (defun func1 [a b c d] (func5 (let [f (func3 c)] (func2 a b f)) (let [e 5] (func4 c d e On Tue, Feb 12,

Google Summer of Code 2013

2013-02-14 Thread Daniel Solano Gómez
Hello, all, It's official: Google Summer of Code 2013 is on. Last year, Clojure was able to get four students who worked on projects like Typed Clojure, Clojure on Android, Clojure and Lua, and Overtone, and I'd love to see Clojure be a mentoring organisation again this year. I have created

proper way to override clojure.core functions without getting warning/error

2013-02-14 Thread AtKaaZ
Let's say I want to override clojure.core/sorted? (ns random.learning.clojure.overridex (:refer-clojure :exclude [sorted?])) (defn sorted? [coll] {:pre [ (coll? coll)]} (clojure.core/sorted? coll)) I'm using Eclipse+counterclockwise, so loading this namespace(Ctrl+Alt+L) first time gives

Re: Google Summer of Code 2013

2013-02-14 Thread David Nolen
WOOT! I'm of course more than happy to mentor any projects around ClojureScript, core.logic, and core.match. David On Thu, Feb 14, 2013 at 1:03 PM, Daniel Solano Gómez cloj...@sattvik.comwrote: Hello, all, It's official: Google Summer of Code 2013 is on. Last year, Clojure was able to

Re: Help on implementing a simple java (openNLP) EventStream interface

2013-02-14 Thread Max Penet
Also It looks like you could use reify instead of proxy here, it would improve performance. http://clojuredocs.org/clojure_core/clojure.core/reify - Max On Thursday, February 14, 2013 3:26:02 PM UTC+1, Ulises wrote: Without testing or anything that looks reasonable enough. I'm sure that

Why is this so difficult?

2013-02-14 Thread BJG145
Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software development, I'm exasperated by what strikes me as a very difficult and primitive set of tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen homepage

Re: proper way to override clojure.core functions without getting warning/error

2013-02-14 Thread Anthony Grimes
The problem is that your first namespace defines 'sorted?' and your second namespace just uses the namespace, thus overriding 'sorted?'. You have two options here. Your biggest project is that you're using ':use'. Use ':require' instead. Something like `(:require

Re: Why is this so difficult?

2013-02-14 Thread Timothy Baldridge
Can you explain a bit more? What do you find difficult about Leinigen? Thanks, Timothy On Thu, Feb 14, 2013 at 11:42 AM, BJG145 benmagicf...@gmail.com wrote: Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software

Re: Library naming etiquette?

2013-02-14 Thread Jim Klucar
Thanks for the replies. I'm not the owner of what the official namespace should be, so perhaps I'll just clj-xxx and I can always stop using that and change with a major release milestone. Clearly too much thought has gone into this already, and there doesn't appear to be a problem with people

Re: Help on implementing a simple java (openNLP) EventStream interface

2013-02-14 Thread Joachim De Beule
Thanks for the tip Max, so you mean like this? (defn cases-event-stream [cases features-extractor labeler] (let [remaining (atom cases)] (reify opennlp.model.EventStream (next [this] (let [current (first @remaining)] (swap! remaining rest)

Re: proper way to override clojure.core functions without getting warning/error

2013-02-14 Thread AtKaaZ
Thank you for replying. I see that using :require like (:require [random.learning.clojure.overridex :as o]) also means I have to use sorted? as o/sorted? else the clojure.core/sorted? is used or using (:require [random.learning.clojure.overridex]) means I've to use

Re: Clojure, Heroku and the dreaded R10 Boot Timeout Error

2013-02-14 Thread Phil Hagelberg
Leonardo Borges writes: Could it be related to new relic? That's the only external service - besides downloading jars - that the app tries to reach upon starting up. If your app is downloading jars on startup that's a bad sign; all your dependencies should be downloaded during git push. If

Re: Why is this so difficult?

2013-02-14 Thread BJG145
What I find exasperating about Leinigen is that I've got a degree in computer science, decades of experience in IT support, and I still haven't been able to get it working yet. :-( Package Manager? Curl? What? OK, look, I'm not very bright. It took me years to get my head round OOP because

Re: Why is this so difficult?

2013-02-14 Thread Lee Spector
I think I have an idea of where your coming from. Leiningen does lots of wonderful and important things but coming from the outside (or at least from certain outsides) it's not even clear why you'd want to do a lot of those things, and it doesn't do some of the things that seem most essential

protocol implementation delegating to protocol extension doesn't compile

2013-02-14 Thread Jim - FooBar();
let me explain with an example: ;;in some namespace x (defprotocol IStemmable (stem [this token] [this token lang]) (getRoot [this token dictionary])) (defprotocol IDistance (getDistance [this s1 s2] [this s1 s2 m-weight])) ;;in some namespace y that refers all vars from x (extend-type

Re: Why is this so difficult?

2013-02-14 Thread Alex Walker
The easiest, when anything becomes a road block, is simply tryclj.comcombined with 4clojure.com. Those two alone can give you enough to work with and chew on while you become more familiar with clojure and setup a proper environment (including Leiningen). Another simplification is to use

new, macros and Can't eval locals

2013-02-14 Thread AtKaaZ
The goal is to can write this form: = *(let [a java.lang.RuntimeException] (new a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) attempt with macro: =* (defmacro mew [cls restt] `(new ~(eval cls) ~@restt)

Re: Why is this so difficult?

2013-02-14 Thread BJG145
Thanks for the suggestions - this really isn't an anti-Leiningen thread, I'm just impatient that I don't understand it yet. But I'll give it another crack and post some more coherent queries when I get stuck...:-) -- -- You received this message because you are subscribed to the Google

[GSoC Idea] cljs layer/dsl over express js

2013-02-14 Thread Omer Iqbal
Just throwing ideas. Feel free to shoot it down if you folks think its not worth it :). Also, I'm a student, and would actually be participating in GSOC, so this is more of a shoutout for possible mentors, if you guys think the project makes sense. The Problem: 1. cljs doesn't yet have a

Re: new, macros and Can't eval locals

2013-02-14 Thread Andy Fingerhut
On Feb 14, 2013, at 1:27 PM, AtKaaZ wrote: The goal is to can write this form: = (let [a java.lang.RuntimeException] (new a) ) CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) attempt with macro: =

Re: new, macros and Can't eval locals

2013-02-14 Thread AtKaaZ
thanks for the reply, = *(defmacro mew [cls args] `(new ~cls ~@args))* #'runtime.q/mew =* (let [a java.lang.RuntimeException] (mew a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) that would be the

Re: new, macros and Can't eval locals

2013-02-14 Thread AtKaaZ
I figure since new is expecting a class at compiletime, we can never pass it a class that we evaluate at runtime(those locals), ergo = impossible to macro around new like that like this = impossible: *(let [a java.lang.RuntimeException] (macro-that-eventually-calls-new a))* maybe

Re: new, macros and Can't eval locals

2013-02-14 Thread AtKaaZ
ok looks like it's not impossible: = *(defmacro mew [cls restt] (let [c a] `(eval (new ~a ~@restt)) ) )* #'runtime.q/mew = *(let [a java.lang.RuntimeException] (mew a) )* #RuntimeException java.lang.RuntimeException On Thu, Feb 14, 2013 at 10:53 PM, AtKaaZ

Re: new, macros and Can't eval locals

2013-02-14 Thread AtKaaZ
and I forgot to mention that I already had another a defined = a java.lang.RuntimeException hence why it worked On Thu, Feb 14, 2013 at 11:01 PM, AtKaaZ atk...@gmail.com wrote: ah I tricked myself... I used ~a inside the macro instead of ~c or ~cls so back to still impossible = (defmacro

Re: new, macros and Can't eval locals

2013-02-14 Thread Aaron Cohen
Yes, since this is runtime you should use reflection. (let [a java.lang.RuntimeException] (.newInstance a)) Alternatively, you can use eval: (let [a java.lang.RuntimeException] (eval (list 'new a))) On Thu, Feb 14, 2013 at 4:53 PM, AtKaaZ atk...@gmail.com wrote: I figure since new is

Re: Why is this so difficult?

2013-02-14 Thread Josh Kamau
This might help: 1. create a new project in the current directory lein new 2. Edit project.clj and add this plugin [lein-idea: 1.0.1] 3. run this to create idea project files lein idea 4. Open the project in intellij Josh On Fri, Feb 15, 2013 at 12:29 AM, BJG145

Re: [GSoC Idea] cljs layer/dsl over express js

2013-02-14 Thread Josh Kamau
Clojure has compojure ... which is a sinatra like web framework and you can create a new project usinglein new compojure and start creating your request handler functions from there ... Just like in express. If you want a jade equivalent... you can use hiccup . Josh. On Fri, Feb 15,

Re: Why is this so difficult?

2013-02-14 Thread Lee Spector
On Feb 14, 2013, at 3:50 PM, Alex Walker wrote: The easiest, when anything becomes a road block, is simply tryclj.com combined with 4clojure.com. Those two alone can give you enough to work with and chew on while you become more familiar with clojure and setup a proper environment

Re: [GSoC Idea] cljs layer/dsl over express js

2013-02-14 Thread Tamreen Khan
But compojure isn't in cljs, so you have to use the jvm. A wrapper around express would mean you could run it on node. On Thu, Feb 14, 2013 at 5:35 PM, Josh Kamau joshnet2...@gmail.com wrote: Clojure has compojure ... which is a sinatra like web framework and you can create a new project

Pretty-printing `lein test`s output?

2013-02-14 Thread vemv
First of all, I must say I'm new to testing in Clojure. My current workflow is pretty simple: * Edit + save the tests (which use clojure.test - I hear Midje is better though) in emacs * Run `lein test` in the terminal * recur But then the printed values (triggered when e.g. an `are` case

How to bind an Aleph TCP server to a TCP v4 port?

2013-02-14 Thread Jorge Luis Pérez
I started to learn Clojure a couple of days ago. I was trying with some Aleph TCP echo server examples but I can not get the server to bind to a tcp v4 port. The server only binds to a tcp v6 port by default. Here my project file: (defproject clj-echo-server 0.1.0-SNAPSHOT :description

Re: Why is this so difficult?

2013-02-14 Thread Jules
You are certainly not alone. Learning the language and concepts is very easy for me, but the sysadmin stuff to get set up is so much harder. Believe it or not, I had much more trouble with installing core.logic than understanding it. It doesn't end either, you bump into more problems once you

Looping and accumulation

2013-02-14 Thread Jonathon McKitrick
I have a loop over a function that is accumulating a list of database keys for later use. But it is primarily doing other processing and returning a collection of processed/filtered records. I'd normally just PUSH the ids and records onto a list in Common Lisp, or even LOOP... COLLECT into 2

Re: [GSoC Idea] cljs layer/dsl over express js

2013-02-14 Thread David Nolen
I responded to Omer on Twitter, it's probably worth looking into existing projects like Bodil Stokke's Dog Fort first - https://github.com/bodil/dogfort David On Thu, Feb 14, 2013 at 5:48 PM, Tamreen Khan histor...@gmail.com wrote: But compojure isn't in cljs, so you have to use the jvm. A

Re: Why is this so difficult?

2013-02-14 Thread vemv
I never tried out core.logic. This is how I just got it installed in less than a minute. Really no magic here: lein new foo; cd foo # google core.logic, grab the dependencies vector ([org.clojure/core.logic 0.7.5]), attach it to your project.clj lein repl (use 'clojure.core.logic)(run* [q]

Re: Why is this so difficult?

2013-02-14 Thread Jules
Sure, but you have assumed that you have a perfectly working clojure environment set up. *That* is the hard part. On Friday, February 15, 2013 12:19:34 AM UTC+1, vemv wrote: I never tried out core.logic. This is how I just got it installed in less than a minute. Really no magic here: lein

Re: Why is this so difficult?

2013-02-14 Thread vemv
If this does not work for you, you can help everyone by opening an issue at the Leiningen bug tracker: Make sure java and curl are correctly installed Run the corresponding (unix or Windows) lein install script Now you should be able to run lein repl, lein new, etc On Friday, February 15, 2013

Re: Looping and accumulation

2013-02-14 Thread vemv
You want either `reduce` or `loop` as the control flow construct, and `conj` for appending items to a collection (without resorting to mutability). Have a look at them, they're pretty well covered in the available books, tutorials etc. Hope it helps - Victor On Friday, February 15, 2013

poker-hands

2013-02-14 Thread James MacAulay
A little library to score poker hands: https://github.com/jamesmacaulay/poker-hands Feedback would be great! -- -- 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: Why is this so difficult?

2013-02-14 Thread Timothy Washington
Hi BJG145, I absolutely see where you're coming from. And in fairness, it did take a me a long and arduous time to get a really proficient development environment. I happen to really like expressive power. So when I came from a Java / OO development paradigm, it didn't bother me that I had to

Re: Looping and accumulation

2013-02-14 Thread Softaddicts
Look at the first example here: http://clojuredocs.org/clojure_core/clojure.core/transient It should inspire you. Transient structures make this kind of loop run faster but as you lay out your first iteration just toss this aside (and the xxx! version of conj and cie). Luc P. I have a loop

Re: Looping and accumulation

2013-02-14 Thread Stephen Compall
On Feb 14, 2013 6:11 PM, Jonathon McKitrick jmckitr...@gmail.com wrote: I have a loop over a function that is accumulating a list of database keys for later use. But it is primarily doing other processing and returning a collection of processed/filtered records. As you come from Common Lisp,

Re: Google Summer of Code 2013

2013-02-14 Thread Jacob Goodson
I would love to improve upon core.match On Thursday, February 14, 2013 1:10:29 PM UTC-5, David Nolen wrote: WOOT! I'm of course more than happy to mentor any projects around ClojureScript, core.logic, and core.match. David On Thu, Feb 14, 2013 at 1:03 PM, Daniel Solano Gómez

Re: Why is this so difficult?

2013-02-14 Thread Mikera
FWIW, I've been using Clojure seriously for a couple of years now and never really used Leiningen. I've found that Eclipse with the awesome Counterclockwise plugin does everything that I need. This is also pretty easy for newcomers (assuming they know Eclipse) - just install the

Re: Pretty-printing `lein test`s output?

2013-02-14 Thread Alex Baranosky
Hi Victor, I've developed something I use on my own projects to compare pretty printed test failure output. The final piece for it would be to incorporate its test failure report diffing into a leiningen plugin that wrapped lein test. https://github.com/AlexBaranosky/gui-diff On Thu, Feb 14,

Re: Why is this so difficult?

2013-02-14 Thread Jules
vemv, here is a file describing my Clojure install experience: https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp How should I continue? And where would a beginner find that information? Hopefully this is taken in good humor, this is meant as an illustration from a beginners' point

Re: Why is this so difficult?

2013-02-14 Thread Konrad Scorciapino
You might, BJG145, also profit by taking a look at clojurewiki.org - I'm listing there all resources I can find. Good luck! 2013/2/15 Jules julesjac...@gmail.com vemv, here is a file describing my Clojure install experience: https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp How

Re: Why is this so difficult?

2013-02-14 Thread Sean Corfield
On Thu, Feb 14, 2013 at 6:56 PM, Jules julesjac...@gmail.com wrote: vemv, here is a file describing my Clojure install experience: https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp How should I continue? And where would a beginner find that information? The problem is the Clojure

Re: Why is this so difficult?

2013-02-14 Thread Michael Klishin
2013/2/15 Konrad Scorciapino scorciap...@gmail.com You might, BJG145, also profit by taking a look at clojurewiki.org - I'm listing there all resources I can find. You may want to add clojure-doc.org, which is the most complete, contributor friendly source of documentation guides (including

Re: [ANN] analyze 0.3.0 - Hygienic transformation

2013-02-14 Thread ronen
It looks as if https://github.com/jonase/kibit/ is a lint/check style tool that only reads the source code, this limits its utilization: Kibit readshttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/read source code without any macro expansion or evaluation. A macro can

Re: [ANN] analyze 0.3.0 - Hygienic transformation

2013-02-14 Thread Jonas
On Friday, February 15, 2013 6:19:00 AM UTC+2, ronen wrote: It looks as if https://github.com/jonase/kibit/ is a lint/check style tool that only reads the source code, this limits its utilization: Kibit readshttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/read

Re: Pretty-printing `lein test`s output?

2013-02-14 Thread Phil Hagelberg
On Thu, Feb 14, 2013 at 3:06 PM, vemv v...@vemv.net wrote: But then the printed values (triggered when e.g. an `are` case fails) are fairly illegible, especially when big. Can I get the test runner to pprint its output? Is my workflow improvable anyway? I use lein-difftest for this:

Re: Pretty-printing `lein test`s output?

2013-02-14 Thread Sean Corfield
You'll find your workflow greatly improved by using nrepl (or slime/swank) and running tests directly from Emacs - and that applies whether you're using bare clojure.test, midje or expectations. I use expectations for testing and expectations-mode in Emacs. I can run an individual namespace's

Re: protocol implementation delegating to protocol extension doesn't compile

2013-02-14 Thread juan.facorro
Hi Jim: I think the problem is that you are actually calling the *getDistance *protocol function with only 2 arguments in the line in bold below: (defrecord LevenshteinDistance [] IDistance (getDistance [_ s1 s2] *(getDistance s1 s2)) ;; - Calling a getDistance function with 2

Re: Why is this so difficult?

2013-02-14 Thread juan.facorro
I feel your pain BJG145, when I started learning Clojure I used Cloojhttps://github.com/arthuredelstein/clooj to be able start playing with the language, it provides the basics, a REPL, a text area for the code and a tree of files and folder for the current project. It's simple and get's you

Re: Why is this so difficult?

2013-02-14 Thread Víctor M . V .
Well the first thing you assume is that project pages should be giant download buttons, and therefore the exposed content in those pages is not worth reading/understanding. For instance you can find the answer to the question posed in the slide 19 in slide 7. Just imagine if every single open

Re: [ANN] analyze 0.3.0 - Hygienic transformation

2013-02-14 Thread Ambrose Bonnaire-Sergeant
Jonas already has another project which uses analyze https://github.com/jonase/eastwood On Fri, Feb 15, 2013 at 12:19 PM, ronen nark...@gmail.com wrote: It looks as if https://github.com/jonase/kibit/ is a lint/check style tool that only reads the source code, this limits its utilization: