Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Christian Sperandio
Use exceptions for control flow makes the developer's work easier but not the one of reader. In other terms the maintenance may become more difficult for the reason given by John. And I think when exceptions are used for control flow, the original exception meaning is forgotten: Exceptions shou

Re: Beginners question - emacs & compiling tests

2013-03-20 Thread Stefan Kamphausen
If you have a valid ns-form and still encounter that error, it may help to compile the file once using C-c C-k. I still need to do that (sometimes?) when I open a file in Emacs although I'd thought, that the complete project should have been loaded at REPL start. After that compilation of singl

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Marko Topolnik
Exceptions are a perfect tool for flow control, if used judiciously. The typical criticism revolves around their incompetent usage, and a more general criticism can be made against a mechanism that is subverted all too easily. If you responsibly keep to the "good parts", exceptions could be the

Re: Beginners question - emacs & compiling tests

2013-03-20 Thread Marko Topolnik
This problem was cross-posted over here from StackOverflow, where it has already been marked as solved. BTW where do you encounter your problem? Inside emacs, with nrepl.el? Because nrepl.el doesn't automatica

Re: Beginners question - emacs & compiling tests

2013-03-20 Thread Stefan Kamphausen
Hi, On Wednesday, March 20, 2013 9:44:19 AM UTC+1, Marko Topolnik wrote: > > This problem was cross-posted over here from > StackOverflow, > > where it has already been marked as solved. oh, sorry, didn't kn

Re: Beginners question - emacs & compiling tests

2013-03-20 Thread Marko Topolnik
On Wednesday, March 20, 2013 10:39:34 AM UTC+1, Stefan Kamphausen wrote: > > To it seems obvious, that I want my complete project loaded and waiting > for my new changes, when I launch a REPL. Maybe that's a leftover from my > Common Lisp days? Why would I want to hit C-c C-k every time I open

Re: Beginners question - emacs & compiling tests

2013-03-20 Thread Stefan Kamphausen
On Wednesday, March 20, 2013 10:44:15 AM UTC+1, Marko Topolnik wrote: > > > Because you usually don't want to wait the eternity it takes to compile > and load absolutely everything. Even loading just the main namespace can be > painfully slow, even if your project is just a few lines, due to th

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Dave Sann
Interesting. Validation is the case I am thinking of - but it might also apply to any situation where you offer a different path of control - i.e. not stepping back up the stack. That's why I mentioned CPS. That's also (maybe) why true tail calls would be useful. The mention of binding dynamic

Clojure in Medellín / Colombia

2013-03-20 Thread Rick Beerendonk
I was wondering if there are Clojure users in Medellín. A user group maybe? -- -- 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 pa

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Marko Topolnik
On Wednesday, March 20, 2013 1:06:54 PM UTC+1, Dave Sann wrote: > Marko, do you have a good example of doing what you say? > What I had in mind, related to OP's post, would be a middleware that does (binding [*validation-failures* []] (handler req) (do-something-about *validation-failure

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Dave Sann
Ok, but how do you take account of different processing (or non processing) needs in the handler (chain) given that something is awry half way down? (note that in my case the handler is not pure - the validation precedes the need for a state change. The state change should occur if the validatio

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Ben Wolfson
On Wed, Mar 20, 2013 at 1:14 AM, Christian Sperandio wrote: > Use exceptions for control flow makes the developer's work easier but not > the one of reader. In other terms the maintenance may become more difficult > for the reason given by John. > > And I think when exceptions are used for control

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread James Reeves
On 20 March 2013 08:36, Marko Topolnik wrote: > If you responsibly keep to the "good parts", exceptions could be the way > to go. Validation is one example where I love them because it happens all > around, but validation failures are all handled uniformly. > If validation happens "all around",

Re: Clojure - CLR - JS - Visual Studio Extension

2013-03-20 Thread dmiller
core.logic should be trivial to port to ClojureCLR. Based on a quick scan, a few changes to JVM lib calls, mostly .write => .Write, a few type hints, UUID => GUID. Could be done in short order. This would be an easy example to play with a common source for Clojure(JVM | CLR). -David On Tuesd

ANN: Morph 0.2.0, state+error-handling with pure functions

2013-03-20 Thread Armando Blancas
Release 0.2.0 of the Morph library comes with a couple of fixes and some enhancements: https://github.com/blancas/morph Safe error-handling with non-global, shared data is now even easier: https://github.com/blancas/morph/wiki/Simpler-State-with-Error-Handling Documentation and samples: https:/

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Marko Topolnik
On Wednesday, March 20, 2013 4:34:32 PM UTC+1, James Reeves wrote: > On 20 March 2013 08:36, Marko Topolnik > > wrote: > >> If you responsibly keep to the "good parts", exceptions could be the way >> to go. Validation is one example where I love them because it happens all >> around, but valida

Re: Immutant and ClojureScript

2013-03-20 Thread Toby Crawley
I've exposed findResource and findResources in ImmutantClassLoader, and this change is available in incremental build 803 or newer[1]. Give that a try and let us know if it doesn't work for you. - Toby [1]:http://immutant.org/builds/ Tatu Tarvainen writes: > So, is that a bug in ClojureScript?

[ANN] Leiningen 2.1.0 released

2013-03-20 Thread Phil Hagelberg
Greetings, hackers. Last night I pushed out version 2.1.0 of Leiningen! Here are some highlights from the release: • Running `lein deps :tree` will now warn you whenever any of your dependencies declare version ranges. Transitive version ranges have been a common source of confusion[1] for a

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Julien Dreux
Thank you all for your answers, I like Marko's approach. What I had in mind, related to OP's post, would be a middleware that does > (binding [*validation-failures* []] >(handler req) >(do-something-about *validation-failures*)) > There would be a global function, such as *add-failure

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Marko Topolnik
> I would still code my own library because I am learning clojure at the > moment. > Question: how is it possible to guarantee that the *failure-list* or > *error-list* is only available to the current request. Is that one of the > properties of :dynamic? > Yes, that's built-in: with (bindin

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Marko Topolnik
On Wednesday, March 20, 2013 5:51:59 PM UTC+1, Julien Dreux wrote: > Thank you all for your answers, > > I like Marko's approach. > > What I had in mind, related to OP's post, would be a middleware that does >> (binding [*validation-failures* []] >>(handler req) >>(do-something-about *

Re: Beginners question - emacs & compiling tests

2013-03-20 Thread tyaakow
As Marko has said, this was answered on stackoverflow. But I appreciate your answers, and the discussion is a joy to read. Cheers!! -- -- 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

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Julien Dreux
Would there be a way of combining this approach with the use of preconditions in clojure? E.g. (defn create-user [user] {:pre validation/user? user} (db/insert! user)) On Wednesday, March 20, 2013 1:00:23 PM UTC-4, Marko Topolnik wrote: > > On Wednesday, March 20, 2013 5:51:59 PM UTC+1, Ju

Re: Map destructuring variations in Pedestal

2013-03-20 Thread Alan Malloy
Yes. Apparently you can put whatever garbage you want into the `:or` map: each local is looked up in that map to see if it has a default, but nobody ever checks to see if there are unused keys in the defaults map. So `:or {::type :jety}` has no impact at all on the generated code: there is no l

Re: nested map destructuring

2013-03-20 Thread Alan Thompson
Nice explanation! --Alan On Tue, Mar 19, 2013 at 1:09 PM, Jim - FooBar(); wrote: > nice one...when thinking like there is literally no confusion. > thank you thank you thank you :) > > Jim > > > > On 19/03/13 20:05, Marko Topolnik wrote: > > Think of it in layers, like this---layer 1: > >

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Cedric Greevey
It will if you use set! to update the binding. On Wed, Mar 20, 2013 at 1:00 PM, Marko Topolnik wrote: > On Wednesday, March 20, 2013 5:51:59 PM UTC+1, Julien Dreux wrote: > >> Thank you all for your answers, >> >> I like Marko's approach. >> >> What I had in mind, related to OP's post, would be

Re: ANN: Morph 0.2.0, state+error-handling with pure functions

2013-03-20 Thread coltnz
So thats at least four clojure monad libraries I know of. This one, https://github.com/bwo/monads, https://github.com/jduey/protocol-monads and the original (?) https://github.com/clojure/algo.monads. Anyone care to comment on the differences beyond use of protocols or not? Pick me a winner...

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-20 Thread Nelson Morris
In lein 2.1 using `lein deps :tree` will print out any version ranges it finds. Hopefully this helps with when noticing similar dependency issues. On Sat, Mar 2, 2013 at 5:42 PM, Nelson Morris wrote: > On Sat, Mar 2, 2013 at 4:17 PM, Frank Siebenlist > wrote: >>> ... >>> The chain causing proble

Re: nested map destructuring

2013-03-20 Thread John D. Hume
On Tue, Mar 19, 2013 at 2:58 PM, Jim - FooBar(); wrote: > awsome!...the full thing actually is {{:keys [w1 w2 w3]} :weights u > :uni-probs b :bi-probs t :tri-probs} You might also consider {:keys [uni-probs bi-probs tri-probs]} {:keys [w1 w2 w3]} :weights} -- -- You received this message becau

Re: ANN: Morph 0.2.0, state+error-handling with pure functions

2013-03-20 Thread Ben Wolfson
On Wed, Mar 20, 2013 at 1:16 PM, coltnz wrote: > So thats at least four clojure monad libraries I know of. This one, > https://github.com/bwo/monads, https://github.com/jduey/protocol-monads and > the original (?) https://github.com/clojure/algo.monads. > > Anyone care to comment on the difference

Re: naming your project "clojure" with "lein new clojure" gives problems

2013-03-20 Thread Kẏra
This is definitely a bug. I just ran into this problem and was not able to decipher the error messages, and digging up this thread wasn't too easy either. On Friday, April 27, 2012 2:17:56 AM UTC-4, Sean Neilan wrote: > > I agree. That would be helpful. > > On Fri, Apr 27, 2012 at 1:12 AM, Sean

Re: naming your project "clojure" with "lein new clojure" gives problems

2013-03-20 Thread Michael Klishin
2013/3/21 Kẏra > This is definitely a bug. I just ran into this problem and was not able to > decipher the error messages, and digging up this thread wasn't too easy > either. It was improved in Leiningen 2.1: it refuses to create projects named "clojure" and only use *jure names if you force i

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread James Reeves
On 20 March 2013 16:41, Marko Topolnik wrote: > On Wednesday, March 20, 2013 4:34:32 PM UTC+1, James Reeves wrote: > >> >> If validation happens "all around", that implies there is no one function >> that can test whether a value of data is valid for a given data store. This >> strikes me as a so

ANN: Simulant, a library for simulation testing

2013-03-20 Thread Stuart Halloway
Wiki/repo: https://github.com/Datomic/simulant/wiki Clojars: https://clojars.org/com.datomic/simulant Presentations: https://github.com/stuarthalloway/presentations/wiki/Simulation-Testing Enjoy! Stu -- -- You received this message because you are subscribed to the Google Groups "Cloju

ANN Monger 1.5.0-rc1

2013-03-20 Thread Michael Klishin
Monger [1] is a Clojure MongoDB driver for a more civilized age: easy to use, documented, fast and with batteries included. Release notes: http://blog.clojurewerkz.org/blog/2013/03/21/monger-1-dot-5-0-rc1-is-released/ 1. http://clojuremongodb.info -- MK http://github.com/michaelklishin http://t

Refactoring tools

2013-03-20 Thread Dave Kincaid
I'm wondering if there are any refactoring tools around for working with Clojure projects in Emacs. There seems to be all kinds of other tools except for refactoring. I'm really looking for simple things like ways to easily rename variables, functions, namespaces, etc. That seems to be the most

Re: Refactoring tools

2013-03-20 Thread Devin Walters
I don't think much has happened with it recently, but I used to use https://github.com/joodie/clojure-refactoring. -- '(Devin Walters) Sent from my Motorola RAZR V3 (Matte Black) On Wednesday, March 20, 2013 at 8:05 PM, Dave Kincaid wrote: > I'm wondering if there are any refactoring tools ar

Re: Refactoring tools

2013-03-20 Thread Dave Kincaid
Thanks. It looks like nothing has happened on that in a year and it appears to require slime/swank. But it's a start I guess if there isn't anything else. On Wednesday, March 20, 2013 6:13:30 PM UTC-7, Devin Walters (devn) wrote: > > I don't think much has happened with it recently, but I used

Re: Refactoring tools

2013-03-20 Thread Devin Walters
Yeah it sort of bums me out that clojure-refactoring has been in the ditch. There are a number of tasks to get this back into a good state. The plan right now is to take tests (which were mostly failing and using outdated dependencies) from the old-test directory and get them passing under Midje

ClassNotFoundException when using fetch RPC from cljs

2013-03-20 Thread Steve Buikhuizen
I'm building a single-page app ( started before Pedestal was announced sadly ) and I'm using the fetch library to support RPC from client -> JVM server. I'm seeing a very strange behaviour. I've defined a view-model ns (full of defrecords) for the client data. This has worked well - the client

Re: Refactoring tools

2013-03-20 Thread Akhil Wali
A fairly new project for refactoring Clojure is clj-refactor.el. Not too much functionality yet, but supplements clojure-refactoring pretty well. clj-refactor.el will later interop with nRepl, or that's the plan I heard. That aside (and I know I'm being redundant), refactoring any Lisp is a snap w