Re: core.async chan ex-handler

2015-01-23 Thread coltnz
On Friday, January 23, 2015 at 12:59:40 AM UTC+13, Derek Troy-West wrote: > > From the documentation: > > (chan buf-or-n xform ex-handler) > > "If a transducer is supplied a > buffer must be specified. ex-handler must be a fn of one argument - > if an exception occurs during transformation it wil

Re: [ANN] bouncer 0.3.2

2015-01-23 Thread Sam Ritchie
We're using Validateur for this: https://github.com/michaelklishin/validateur Not sure if you've seen that one either. Schema is more of a type-system-lite - it's not very good out of the box at allowing you to validate form data and return nice error messages in a way that's easy for some fo

Re: aot resolve question

2015-01-23 Thread Michael Blume
Not sure what to tell you. If you can post code we can use to reproduce the problem, that would help. Alternately, put some println statements into load-sym so you can be sure it's getting the values you think it is? On Tue Jan 20 2015 at 11:45:34 PM bob wrote: > Hi, > > I have a function > > (d

Re: vectorz, "Unable to find implementation", uberjar, excluding source

2015-01-23 Thread Michael Blume
If you want to keep jar size down and avoid class loader problems, instead of excluding source I'd avoid aot and only ship source. If you need the JVM to find your main class you can write a shim and only aot-compile that. On Wed Jan 21 2015 at 12:36:03 PM Brian Craft wrote: > Fixed it by adding

Re: Set equality bug?

2015-01-23 Thread Luc Prefontaine
Obviously... user=> (= (byte 1) (short 1) (long 1) 1) true user=> http://clojure.org/rationale Language as platform vs. language + platform - Old way - each language defines its own runtime GC, bytecode, type system, libraries etc - New way (JVM, .Net) - Common runtime independent o

Re: Satisfies? seems strangely slow

2015-01-23 Thread Fluid Dynamics
On Friday, January 23, 2015 at 3:13:08 PM UTC-5, Tassilo Horn wrote: > > philli...@newcastle.ac.uk (Phillip Lord) writes: > > >> I use satisfies? for optional features, e.g., if some data structure > >> satisfies some protocol, then that optional feature is enabled, else > >> it's disabled. Bu

Re: Set equality bug?

2015-01-23 Thread Fluid Dynamics
And this is not a typeless language, it is a strongly dynamically typed language. -- 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

Re: Set equality bug?

2015-01-23 Thread Fluid Dynamics
On Friday, January 23, 2015 at 1:27:18 PM UTC-5, Luc wrote: > > Danger vs flexibility. > > < or > are safe. Should they throw an exception then ? > > Compiler in some older typed languages would warn you about testing > equality between two float numbers irrelevant of their types but would be >

Re: Satisfies? seems strangely slow

2015-01-23 Thread Tassilo Horn
phillip.l...@newcastle.ac.uk (Phillip Lord) writes: >> I use satisfies? for optional features, e.g., if some data structure >> satisfies some protocol, then that optional feature is enabled, else >> it's disabled. But that's not really on a hot path so I don't care >> much about satisfies? perfor

Re: Set equality bug?

2015-01-23 Thread Luc Prefontaine
Danger vs flexibility. < or > are safe. Should they throw an exception then ? Compiler in some older typed languages would warn you about testing equality between two float numbers irrelevant of their types but would be silent about other operators. Testing equality with floats is seldom used

Re: Set equality bug?

2015-01-23 Thread Mark Engelberg
If the underlying argument is that it is horribly dangerous to mix floats and doubles in your code, then maybe (<= (float 1.5) (double 1.5)) should have the semantics of (.compareTo (float 1.5) (double 1.5)), i.e., throw an error. I'm not certain that's a good idea for Clojure, but it does seem li

Re: Set equality bug?

2015-01-23 Thread Michael Gardner
On Jan 23, 2015, at 11:51 AM, Andy Fingerhut wrote: > Hash consistency is certainly nice, but if Clojure were changed such that (= > float-val double-val) were always false, and no other changes were made, it > would lead to this situation: > > user=> (<= (float 1.5) (double 1.5)) > true > user

Re: Set equality bug?

2015-01-23 Thread Andy Fingerhut
Not sure which properties you prefer to be true in programming languages you use. Hash consistency is certainly nice, but if Clojure were changed such that (= float-val double-val) were always false, and no other changes were made, it would lead to this situation: user=> (<= (float 1.5) (double 1

Re: [ANN] bouncer 0.3.2

2015-01-23 Thread Laurens Van Houtven
Looks awesome! I’m currently using prismatic/schema for what seems like exactly the same thing; could you enlighten me how the two libraries are different? thanks lvh > On Jan 23, 2015, at 3:39 AM, Leonardo Borges > wrote: > > bouncer is a validation library for Clojure apps > > Github: ht

[job] Write Clojure/ClojureScript with us in Boston

2015-01-23 Thread Isaac Cambron
Hi everyone, Zensight is an all-Clojure/ClojureScript startup in Cambridge, MA, and we're hiring full-stack engineers. We're solving some interesting data processing, machine learning, and information retrieval problems, as part of a product to help sales people be more effective at communicati

Re: Set equality bug?

2015-01-23 Thread Michael Gardner
On Jan 23, 2015, at 8:23 AM, Andy Fingerhut wrote: > You can try creating a JIRA ticket suggesting that Clojure's = should return > false when comparing floats and doubles to each other. CLJ-1649, for anyone interested. -- You received this message because you are subscribed to the Google Grou

Re: [ANN] bouncer 0.3.2

2015-01-23 Thread Andrey Antukh
Great library! I don't know about it! Thanks! 2015-01-23 15:54 GMT+01:00 Plínio Balduino : > This is awesome, Leonardo > > On Fri, Jan 23, 2015 at 9:39 AM, Leonardo Borges < > leonardoborges...@gmail.com> wrote: > >> bouncer is a validation library for Clojure apps >> >> Github: https://github.co

Re: [ANN] bouncer 0.3.2

2015-01-23 Thread Plínio Balduino
This is awesome, Leonardo On Fri, Jan 23, 2015 at 9:39 AM, Leonardo Borges < leonardoborges...@gmail.com> wrote: > bouncer is a validation library for Clojure apps > > Github: https://github.com/leonardoborges/bouncer > Clojars: https://clojars.org/bouncer > > The main change with 0.3.2 is that b

Re: Set equality bug?

2015-01-23 Thread Andy Fingerhut
Michael: You can try creating a JIRA ticket suggesting that Clojure's = should return false when comparing floats and doubles to each other. I have no idea if it would go anywhere, but alternative (2) trying to get hashes to be equal between = float/doubles has been suggested and declined. Witho

Re: Set equality bug?

2015-01-23 Thread Michael Gardner
I'm sure we are all aware of the various issues with floating point math (particularly equality comparisons); however none of that is relevant to this discussion. The only issue here is an inconsistency between hashing and equality testing in Clojure. My claim is that the property "any two obje

Re: Set equality bug?

2015-01-23 Thread Luc Prefontaine
public class TestClass { public static void equality () { double dd = 3.5; float ff = 3.5f; System.out.println(String.format("dd vs ff == %b", dd==ff)); double dd2 = 3.2; float ff2 =

[ANN] bouncer 0.3.2

2015-01-23 Thread Leonardo Borges
bouncer is a validation library for Clojure apps Github: https://github.com/leonardoborges/bouncer Clojars: https://clojars.org/bouncer The main change with 0.3.2 is that bouncer now works with Clojurescript! - thanks Robin(@Skinney)! New validators have also been added. You can read more about

Re: Set equality bug?

2015-01-23 Thread Luc Préfontaine
Well if it breaks elsewhere than in your code because you mix representations and leak them to some library in Java that you do not control I see my comments as absolutely relevant. It's not technical, it's failsafe. But that might not be of any interest to your problem scope. However it does i

Re: Satisfies? seems strangely slow

2015-01-23 Thread Phillip Lord
Tassilo Horn writes: >> I don't think satisfies? is worth optimizing as using ton of it seems >> antithetical to protocols. It signals to me that a caller does in fact >> care about the implementation, whereas protocols are about not >> caring. Like your PR, if you want to ensure a protocol's cove

Re: Set equality bug?

2015-01-23 Thread Michael Gardner
If there's a technical reason why Clojure can't return false for all = comparisons between floats and doubles, I'd like to hear it. Otherwise, I don't see how your response is relevant. > On Jan 23, 2015, at 3:10 AM, Luc Prefontaine > wrote: > > Agree, it's broken... in java... > Has it has b

Re: Set equality bug?

2015-01-23 Thread Mark Engelberg
On Fri, Jan 23, 2015 at 1:10 AM, Luc Prefontaine < lprefonta...@softaddicts.ca> wrote: > Agree, it's broken... in java... > I think it's more frustrating in Clojure than in Java, though, because in Java you have those big, ugly type annotations on every single variable, input and output, so there

Re: Set equality bug?

2015-01-23 Thread Luc Prefontaine
Agree, it's broken... in java... Has it has been broken in the past in several architectures... I understand your frustration but this is not something new. It's been a problem for at least 30 years. It is kind of a basic programming issue: - Never compare floats with different representations.

Re: Set equality bug?

2015-01-23 Thread Michael Gardner
On Jan 23, 2015, at 1:33 AM, Immo Heikkinen wrote: > > I actually ran into this while comparing nested data structures from two > different sources and spent a good part of my day figuring out what's > happening. While it is a good advice to avoid mixing floats and doubles, it > is inevitable