Re: [ANN] Counterclockwise 0.26.0

2014-07-13 Thread casper
Nice. Keep up the awesome work :) On Thursday, July 10, 2014 10:53:59 PM UTC+2, laurent.petit wrote: > > Hello, > > Counterclockwise 0.26.0 has just been released. > > This version fixes lots of longstanding, unnerving usability issues. > > Please see the Changelog for detailed explanations: > >

How to return a value from catch block

2014-07-13 Thread sindhu hosamane
(defn convert-to-float [a] (try (if (not= a " ") (read-string a)) (catch Exception e (str "caught exception :" (.getMessage e) After using the above convert-to-float function ,I get output like below when i have empty strings . -

Re: How to return a value from catch block

2014-07-13 Thread Torsten Uhlmann
You could wrap the catch expression in a do block and return something at the end of the block. That means that the other statements in the do block must produce some side effect, like logging the error message: (defn convert-to-float [a] (try (if (not= a " ") (read-string a)) (ca

Re: How to return a value from catch block

2014-07-13 Thread Thomas Heller
catch returns the value of the last statement, so instead of the (str) you could just return 0.0. Also don't use read-string if you only expect floating point numbers, otherwise (convert-to-float ":hmm") returns :hmm, not exactly a float. Since closure uses Double as the default floating point

Re: How to use functions from clojure.contrib?

2014-07-13 Thread Pierre Masci
Haha, I've randomly come accross this exact same function in Prismatic/plumbing , plus a bunch of other interesting ones. I'll use that version from now. On Wednesday, 9 July 2014 13:26:21 UTC+1, Pierre Masci wrote: > > Thank you Andy, that's exactly the a

Re: Determine file of auxiliary test method with clojure.test?

2014-07-13 Thread Colin Fleming
Hi Jeff, Sorry for the late reply - that's great, thanks very much, looks like I can hack something together with that. Cheers, Colin On 11 July 2014 03:12, Jeff Valk wrote: > You could override the clojure.test/do-report implementation and use the > same stack frame trick that the default :f

Protocol equivalent of Python's `repr`?

2014-07-13 Thread Sam Raker
I'm working my way through an intro to Clojure book, and I just got to the section on protocols. I might be missing something/committing a category error, but I'm wondering if there's a way to change the way a protocol is represented in the repl, akin to redefining `__repr__`/`__str__` in Python

Re: Protocol equivalent of Python's `repr`?

2014-07-13 Thread James Reeves
The multimethods print-method and print-dup handle this. - James On 13 July 2014 18:51, Sam Raker wrote: > I'm working my way through an intro to Clojure book, and I just got to the > section on protocols. I might be missing something/committing a category > error, but I'm wondering if there's

Re: Protocol equivalent of Python's `repr`?

2014-07-13 Thread Jony Hudson
You might also enjoy looking at Gorilla REPL [1], which has an easily extensible renderer [2] for just this sort of thing. Disclosure: I'm one of its authors! Jony [1] http://gorilla-repl.org [2] http://vimeo.com/89532785 On Sunday, 13 July 2014 18:51:40 UTC+1, Sam Raker wrote: > > I'm workin

Re: Protocol equivalent of Python's `repr`?

2014-07-13 Thread Sam Raker
James: I haven't gotten to multimethods yet--I'll definitely check that out! Jony: I use Gorilla REPL for basically all my clojure stuff already! It's really great, thanks so much. I know you can add stuff to project.clj to pretty-print everything in the repl, I was just wondering about targeting

working intellij plugin?

2014-07-13 Thread Brian Craft
In need of a way to breakpoint in java code, I decided to look at intellij. I tried the directions here: http://wiki.jetbrains.net/intellij/Getting_started_with_La_Clojure which don't work. When trying to open a project, it throws: java.lang.NoSuchMethodError: com.intellij.openapi.module.Modif

Re: working intellij plugin?

2014-07-13 Thread Mark Mandel
Try this for IntelliJ instead. It's far better: https://cursiveclojure.com/ Mark On Mon, Jul 14, 2014 at 11:35 AM, Brian Craft wrote: > In need of a way to breakpoint in java code, I decided to look at > intellij. I tried the directions here: > > http://wiki.jetbrains.net/intellij/Getting_sta

Re: [nginx-clojure] Getting started question

2014-07-13 Thread Xfeep Zhang
Hi Boris If there 's no port conflict, you can run multiple nginx instances without any problem. So if you do installation by binary you needn't remove the prior version. If you don't want to run multiple nginx instances , you can stop the old one and copy the configuration files to the new one

Re: working intellij plugin?

2014-07-13 Thread Colin Fleming
HI Brian, Both La Clojure and the IntelliJ Leiningen plugin are effectively discontinued in favour of Cursive. There's full instructions on how to get started here: https://cursiveclojure.com/userguide. Let me know if you have any more questions. Cheers, Colin On 14 July 2014 03:35, Brian Craft