Re: 2 way transform in single definition ? unification ?

2015-07-14 Thread Jules
This does look good - I'll give it a whirl - thanks for the example :-) Jules On Monday, 13 July 2015 11:00:55 UTC+1, Jonathan Winandy wrote: To me it's a very good option. Given you example : (./pull '[org.clojure/core.logic 0.8.10]) (ns yo (:refer-clojure :exclude [==]) (:use

Re: 2 way transform in single definition ? unification ?

2015-07-13 Thread Gary Verhaegen
Have you already looked at core.logic? On Monday, 13 July 2015, craig worrall craig.worr...@transacumen.com wrote: You may have already discounted Java versions, but just in case ... http://www.javacodegeeks.com/2013/10/java-object-to-object-mapper.html Craig On Monday, July 13, 2015 at

Re: 2 way transform in single definition ? unification ?

2015-07-13 Thread Jules
I haven't. Are you just suggesting it because I mentioned unification, or have you used it and know that it might be a good fit ? Thanks, Jules On Monday, 13 July 2015 10:37:55 UTC+1, Gary Verhaegen wrote: Have you already looked at core.logic? On Monday, 13 July 2015, craig worrall

Re: 2 way transform in single definition ? unification ?

2015-07-13 Thread Jonathan Winandy
To me it's a very good option. Given you example : (./pull '[org.clojure/core.logic 0.8.10]) (ns yo (:refer-clojure :exclude [==]) (:use [clojure.core.logic])) (defne a-to-b [x y] ([ {:a {:b b :c c}} [b [c]] ])) (run* [a] (a-to-b a [1 [2]])) ;#= ({:a {:b 1, :c 2}}) On 13 July

Re: 2 way transform in single definition ? unification ?

2015-07-13 Thread Jules
I was hoping for something in idiomatic Clojure - but I'll take a look thanks. Jules On Monday, 13 July 2015 04:45:00 UTC+1, craig worrall wrote: You may have already discounted Java versions, but just in case ... http://www.javacodegeeks.com/2013/10/java-object-to-object-mapper.html

Re: 2 way transform in single definition ? unification ?

2015-07-13 Thread Gary Verhaegen
I have not used it. I'm mentioning it because you mentioned unification and prolog and because you basically want a two-way function, which is what was touted as the ideal use-case for core.logic when it was heavily discussed on this list a few months (years?) ago. I'm not aware of the details of

Re: 2 way transform in single definition ? unification ?

2015-07-12 Thread craig worrall
You may have already discounted Java versions, but just in case ... http://www.javacodegeeks.com/2013/10/java-object-to-object-mapper.html Craig On Monday, July 13, 2015 at 3:53:19 AM UTC+10, Jules wrote: Guys, I have an external and an internal data representation. I need to define

2 way transform in single definition ? unification ?

2015-07-12 Thread Jules
Guys, I have an external and an internal data representation. I need to define transforms both ways. Both models are structured. A pair of in/out functions might look like: (fn [{{b :b c c:} :a}] [b [c]]) (fn [[b [c]] {:a {:b b :c c}}) I just typed that OTTOMH so please forgive any