Re: Education on Dynamic Binding

2015-05-28 Thread piastkrakow
What blog posts did you find useful? On Tuesday, May 26, 2015 at 10:01:29 PM UTC-4, andy.c...@fundingcircle.com wrote: > > This page on Jira says that dynamic binding should be documented as "The > Clojure Way" to do error handling. Was this ever done? I managed to find a > few blog posts disc

Re: How can I remove this "nil?" check from my code?

2015-05-28 Thread piastkrakow
Thank you all. I especially like the use of reduce-kv and the 2 fnils. I looked at reduce-kv, but I was too stupid to figure out how to apply it here. On Tuesday, May 26, 2015 at 12:27:16 PM UTC-4, Francis Avila wrote: > > Your two functions can be written more succinctly (and with fewer expl

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-28 Thread Tassilo Horn
Andy Fingerhut writes: Hi Andy, > Tassilo, the issue with flatland.ordered.set/ordered-set was that > library had never been updated to match the change in hash function > that occurred when Clojure 1.6.0 was released. > > Alan Malloy released a new version of the ordered library today that > fi

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-28 Thread Andy Fingerhut
Tassilo, the issue with flatland.ordered.set/ordered-set was that library had never been updated to match the change in hash function that occurred when Clojure 1.6.0 was released. Alan Malloy released a new version of the ordered library today that fixes that. That has no effect on the other CLJ

Re: clojure edn function reader

2015-05-28 Thread ronen
Leon spot on, maybe ill get to implement such a thing :) On Friday, May 29, 2015 at 2:44:04 AM UTC+3, ronen wrote: > > Gary your last comment hits what I look for exactly: > > "If you are looking for an encoding of clojure's syntax extensions into > pure edn reader tags (as my crystall ball tell

Re: clojure edn function reader

2015-05-28 Thread ronen
Gary your last comment hits what I look for exactly: "If you are looking for an encoding of clojure's syntax extensions into pure edn reader tags (as my crystall ball tells me you might be), I haven't encountered such a thing yet, even though it's conceivable." My use case is to pass functions

Re: clojure edn function reader

2015-05-28 Thread Leon Grapenthin
I don't know of any open source implementation of the Datomic function literal. It shouldn't be too difficult and a great excercise. However just using read and eval won't suffice. Datomic creates an anonymous namespace around for each of those functions with the specified requires and imports

Re: Get anonymous function's(which is parameter to function) body in called function

2015-05-28 Thread Herwig Hochleitner
2015-05-28 19:42 GMT+02:00 Mohit Thatte : > > The interesting question here is what constitutes useful information! > (let [pred #(exists? ".foo")] (wait-until pred)) ;; <- the fact that it's called 'pred is not interesting in most cases > The trade-off is breaking an existing public API. > H

Re: Get anonymous function's(which is parameter to function) body in called function

2015-05-28 Thread Mohit Thatte
"but it won't give useful information if you don't construct the op inline." The interesting question here is what constitutes useful information! The trade-off is breaking an existing public API. If Shalaka's primary goal is prettier errors in test failures, I'd settle for the fn body itself as

Re: Get anonymous function's(which is parameter to function) body in called function

2015-05-28 Thread Herwig Hochleitner
2015-05-28 19:22 GMT+02:00 Mohit Thatte : > Changing wait-until to a macro seems like the simplest way to tackle this. > It gives you access to pred at compile time, does not force the caller to > add meta-data to pred, and you can construct the error message as you like. > I was actually thinkin

Re: Get anonymous function's(which is parameter to function) body in called function

2015-05-28 Thread Mohit Thatte
Hi Shalaka, +1 to what Herwig said. Changing wait-until to a macro seems like the simplest way to tackle this. It gives you access to pred at compile time, does not force the caller to add meta-data to pred, and you can construct the error message as you like. The challenge with your approach 1

Re: Interop: mutability vs. inheritance

2015-05-28 Thread Mars0i
> >I think that's correct (with the exception you already mention yourself: > >you can use a :state structure containing multiple values). > > OK. If you care mostly about performance, maybe using an array as :state > will do. That's always mutable and access is really fast. > Oh, nice id

Re: clojure edn function reader

2015-05-28 Thread Gary Verhaegen
Not very clear to me either, but, in the spirit of reducing the field of possible understandings of the question: are you aware of eval? If so, can you reframe your question around it, i.e. what is it missing for your use-case or haw it's not a good fit? (If you are not yet aware of eval, know that

Re: Get anonymous function's(which is parameter to function) body in called function

2015-05-28 Thread Herwig Hochleitner
I'd definitely go with 1.), because the `exec` in 2.) is basically `eval` and thus should be used most sparingly. You can also expand on 1.) by using a macro, that stores the source and other debugging information in metadata and thus get all the benefits of 2.) and then some. -- You received thi

Re: clojure edn function reader

2015-05-28 Thread Herwig Hochleitner
2015-05-27 18:14 GMT+02:00 ronen : > Ok ill expand the question a bit hoping to make it clearer :) > Still not clear to me, but I'll try to expand a bit in the hope of showing what is unclear. Clojure EDN has support for literal tags > and

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-28 Thread Alex Miller
CLJ-1649 is separate and unrelated to what you logged. On Thu, May 28, 2015 at 7:16 AM, Tassilo Horn wrote: > Alex Miller writes: > > > This a dupe of CLJ-1372. > > Yes, I guessed so and therefore mentioned CLJ-1372 in the description. > > What about the other related issue I mentioned (CLJ-164

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-28 Thread Tassilo Horn
Alex Miller writes: > This a dupe of CLJ-1372. Yes, I guessed so and therefore mentioned CLJ-1372 in the description. What about the other related issue I mentioned (CLJ-1649). Also a dupe of CLJ-1372? Bye, Tassilo -- You received this message because you are subscribed to the Google Groups

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-28 Thread Alex Miller
This a dupe of CLJ-1372. -- 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 g

Get anonymous function's(which is parameter to function) body in called function

2015-05-28 Thread Shalaka Patil
I have one function wait-until whose definition is like- (defn wait-until [pred] (wait-until* pred)) where, pred is a function & wai-until* is some internal working. Now, I want to modify it like- (defn wait-until [pred] (try (wait-until* pred) (catch Exception e (printl

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-28 Thread Tassilo Horn
Hi Alex, I've spotted another bug which I've already reported http://dev.clojure.org/jira/browse/CLJ-1739. The problem is that sets of different kinds are equal which is of course expected, e.g., (= #{1 2 3} (flatland.ordered.set/ordered-set 1 2 3)) ;=> true (= #{1 2 3} (java.util.HashSet. [