Re: core.logic: question on ordering in conjunction

2013-06-30 Thread Steven Devijver
How does one recognize a relational or non-relational goal? Thanks for the fd example. On Sunday, June 30, 2013 7:34:58 PM UTC+2, Norman Richards wrote: > > What you are trying to do is non-relational, and will only work when you > put the non-relational pluso at the end. > > You can obviously

core.logic: question on ordering in conjunction

2013-06-30 Thread Steven Devijver
I wrote this goal: (use 'clojure.core.logic) (use 'clojure.core.logic.protocols) (defn pluso [t1 t2 s] (fn goal [a] (let [args (map (partial walk a) [t1 t2 s]) fresh? (map lvar? args) ground? (map not fresh?) [t1 t2 s] args] (cond (= [true true

= and byte arrays

2010-08-03 Thread Steven Devijver
Given two byte arrays that have the same content (value) the code below runs without errors: (def ba1 (...)) (def ba2 (...)) (assert (not= ba1 ba2)) (assert (= (String. ba1) (String ba2))) Is this as expected? -- You received this message because you are subscribed to the Google Groups "Clojur

Re: Complex type in clojure

2010-06-08 Thread Steven Devijver
On 8 jun, 19:43, ataggart wrote: > On Jun 8, 6:33 am, Steven Devijver wrote: > > > On 8 jun, 05:47, Daniel wrote: > > > > These notation arguments are compelling. > > > I'm not convinced. The notation would only work for literals > > Correct. >

Re: Complex type in clojure

2010-06-08 Thread Steven Devijver
On 8 jun, 16:38, Mike Meyer wrote: > > Why? It isn't supported for rationals or exponents. Or are you > claiming that because we support "3/4" we should also support > > (* (my-complicated-algo val)/(my-other-complicated-algo exp) >    1/(another-complicated-algo exp2)) > > with similar problems

Re: Complex type in clojure

2010-06-08 Thread Steven Devijver
On 8 jun, 05:47, Daniel wrote: > These notation arguments are compelling. > I'm not convinced. The notation would only work for literals, and how often would one write literal complex numbers? For non-literals the notation would need to support this: (* (my-complicated-algo x)+(my-other-compl

Re: Complex type in clojure

2010-06-07 Thread Steven Devijver
For what it's worth, I found that working with complex numbers in clojure doesn't require specialist types or notation at all: (defn complex-times [[a_re a_im] [b_re b_im]] [(- (* a_re b_re) (* a_im b_im)) (+ (* a_re b_im) (* a_im b_re))]) (defn complex-plus [[a_re a_im] [b_re b_im]] [(+ a_re b_r

Re: Which git version for cells?

2010-05-17 Thread Steven Devijver
On 17 mei, 19:25, "Eric Schulte" wrote: > Hi Steven, > > I recently put together a propagator/cell system using Clojure's > actors/watchers.  The code for implementing a concurrent propagator > system actually came out to a little less than a single page.  Take a > look at the following for the

Re: new Clojure Compiler...

2010-05-17 Thread Steven Devijver
On 17 mei, 08:48, Fabio Kaminski wrote: > first that dinamic languages are better for developers, but you loose some > performance compared to typed languages.. and jvm was created with types in > mind.. so right now clojure data structures are implemented in java and > typed, when you get it in

Which git version for cells?

2010-05-16 Thread Steven Devijver
I'm experimenting with cells in clojure and am currently using the "lazy" branch for this. However, I'm getting some strange behavior. So my question is: which branch should I be using if I want to test- drive the watcher feature? Thanks -- You received this message because you are subscribed t

Leaky configuration with multi-methods

2010-05-12 Thread Steven Devijver
Hey, I have this multi-method setup: (defmulti dsl-walk :Rule) (defmulti component-constructor :Component) (defmethod dsl-walk :SymbolPlus [r] (let [children (map dsl-walk (:recurrent r))] (apply component-constructor (list {:Component (keyword (:symbol r)) :children chi

Re: Impact of gen-class on clojure-ness

2010-03-29 Thread Steven Devijver
On 29 mrt, 09:43, Jarkko Oranen wrote: > Interfaces are good, but defining your own is mainly reserved for Java > interop. You should strive to use plain old untyped data structures > for your data, ie. just put things in maps, vectors, sets andl lists. > Write (pure) functions to transform the

[Noob] Impact of gen-class on clojure-ness

2010-03-28 Thread Steven Devijver
be living in a different world if I would just implement my functions and pass those functions around as function arguments without using Java interfaces and gen-class? Thanks Steven Devijver -- You received this message because you are subscribed to the Google Groups "Clojure" group. T