Re: ANN: ClojureScript 0.0-2644, enhanced REPLs

2015-01-02 Thread David Nolen
Forgot to add for maintainers of existing custom REPLs the following is essential reading: https://github.com/clojure/clojurescript/wiki/Custom-REPLs Most of the changes have been made towards *decreasing* the amount of custom logic REPLs need to implement. -setup really becomes a bootstrapping p

Re: How to handle refactoring with TDD and mocking/stubbing

2015-01-02 Thread Brian Marick
Timothy Baldridge wrote: I don't recommend Midje at all. Many of the framework's mocking facilities (such as providing) are abominations. Hacker News notwithstanding, "idiosyncratic interface" is not a synonym for abomination. It may look cute, but I've lost countless hours to bugs and un

Re: How to handle refactoring with TDD and mocking/stubbing

2015-01-02 Thread Brian Marick
I use TDD and mocking/stubbing (conjure) to test each layer of my code. The problem is when I change the function signature and the tests do not break, because the mocks/stubs do not know when their argument lists no longer agree with the underlying function they are mocking. Is there a way to

Re: beginner (fn) doubt

2015-01-02 Thread Fluid Dynamics
On Friday, January 2, 2015 8:13:41 PM UTC-5, novato wrote: > > I choose clojure as my first programming language after some research. I > am learning by doing Clojure Koans exercises. > I reached to the functions "lesson" and I have a doubt on the following > code: > (

beginner (fn) doubt

2015-01-02 Thread novato
I choose clojure as my first programming language after some research. I am learning by doing Clojure Koans exercises. I reached to the functions "lesson" and I have a doubt on the following code: ((fn [x] (* 5 x)) 5) Why is that the last 5 is outside the fn parenthes

The Essence of ClojureScript Redux

2015-01-02 Thread David Nolen
I've posted a simple walkthrough of the new Node.js REPL: http://swannodette.github.io/2015/01/02/the-essence-of-clojurescript-redux/ I suspect people will be reaching for ClojureScript REPLs significantly more often than in the past :) David -- You received this message because you are subscr

Re: lazy-seq performance

2015-01-02 Thread Sakis K
Thanks for the tips. This indeed looks like an OpenJDK big int poor performance issue. For the reference, the results of two recur-based implementations: user=> (defn fib [n] #_=> (loop [n n a 0N b 1N] #_=> (if (zero? n) a (recur (dec n) b (+ a b) #'user/fib user=> (time (rem (fib 1000

Re: [ClojureScript] ANN: ClojureScript 0.0-2644, enhanced REPLs

2015-01-02 Thread Mimmo Cosenza
may I borrow some energy from you? you’re awesome thanks, thanks. thanks so much! mimmo > On 03 Jan 2015, at 00:18, David Nolen wrote: > > ClojureScript, the Clojure compiler that emits JavaScript source code. > > README and source code: https://github.com/clojure/clojurescript > > New rele

ANN: ClojureScript 0.0-2644, enhanced REPLs

2015-01-02 Thread David Nolen
ClojureScript, the Clojure compiler that emits JavaScript source code. README and source code: https://github.com/clojure/clojurescript New release version: 0.0-2644 Leiningen dependency information: [org.clojure/clojurescript "0.0-2644"] This release is one of the most significant in a ve

Re: How to find adjacent cells in a matrix with core.logic ?

2015-01-02 Thread rogergl
>>Also in this case I don't really see the value over writing the search directly - but your goals are not clear to me<< It's just an exercise to get a feel for what core.logic can be used for. Regards Roger > > -- You received this message because you are subscribed to the Google Groups "

Re: Please critique my code (barber problem with core.async)

2015-01-02 Thread Thomas
On Friday, 2 January 2015 16:45:14 UTC, Erik Price wrote: > > ;(async/timeout (* 10 1000)) ;; not sure why this doesn’t work here, > would make it portable to clojureScript I think > > Did you forget to use > e > .. :) thank you!!! Thomas -- You received this message b

Re: ANN: Om 0.8.0-rc1

2015-01-02 Thread Kristofer Svärd
Do I still need to specify an externs file when compiling with advanced optimization? I found that from Om 0.8.0-beta4 specifying both :optimizations :advanced and :externs ["react/externs/react.js"] gives a compilation error ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input: file:/home

Re: How to find adjacent cells in a matrix with core.logic ?

2015-01-02 Thread Tobias Kortkamp
Move membero to the beginning (just after fresh, like in succo), it runs in < 100 ms on my machine then. -- 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 ar

Re: How to find adjacent cells in a matrix with core.logic ?

2015-01-02 Thread David Nolen
If you are going to optimize core.logic programs you really need to understand the implications of a Prolog-like system. The same optimization strategies tend to apply. Also in this case I don't really see the value over writing the search directly - but your goals are not clear to me. David On

Re: Using dev/user.clj breaks java compilation

2015-01-02 Thread Thomas Heller
I had a similar problem some time ago. The analysis is correct that Clojure will always load user.clj. As a workarround I just moved the require out of the ns form. (ns user (:require [mdg.meat2])) becomes (ns user) (defn start [] (require 'mdg.meat2 :reload-all) (do-something-useful))

Re: How to find adjacent cells in a matrix with core.logic ?

2015-01-02 Thread rogergl
Ok, the execution time is about 3sec in a standalone repl. Much faster but imho still way to slow. Regards Roger -- 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 n

Using dev/user.clj breaks java compilation

2015-01-02 Thread David James
I noticed this issue which I'm currently facing: https://github.com/technomancy/leiningen/issues/1477 Technomancy commented in the issue: "This appears to be a bug in Clojure causing an incorrect error message that's masking the actual issue. What's happening here is that the javac task is invok

How to find adjacent cells in a matrix with core.logic ?

2015-01-02 Thread rogergl
I would like to find the entries with 4 adjacent cells (horizontally or vertically) ? Is this the right way to do this ? I don't think so, since my solution seems to be very slow. Evaluating in LightTable takes about 10 seconds. (def matrix [ {:row 1 :col 1}

Compiling gen-class runs static initializers: workarounds, solutions?

2015-01-02 Thread David James
I have a problem when compiling while using gen-class with static initializers. I use gen-class to extend a JavaFX 8 class, javafx.scene.control.Control. During compilation, a static initializer is run, raising an exception saying that the JavaFX toolkit has not been initialized. I'm going t

Re: How to write tests fro vertx and Clojure

2015-01-02 Thread Toby Crawley
Ah, right. When embedded, you'll have to use a platform manager to deploy verticles. See http://vertx.io/mod-lang-clojure/docs/1.0.4/vertx.embed.platform.html. However, moving the code out of the veriticles for testing is probably a better idea. - Toby On Sun, Dec 28, 2014 at 1:06 PM, rogergl w

Re: Please critique my code (barber problem with core.async)

2015-01-02 Thread Erik Price
;(async/timeout (* 10 1000)) ;; not sure why this doesn’t work here, would make it portable to clojureScript I think Did you forget to use wrote: > Happy New to all of you!!! > > Recently I came across the barber problem (again) and while reading it I > thought that code.async would be ideal fo

Please critique my code (barber problem with core.async)

2015-01-02 Thread Thomas
Happy New to all of you!!! Recently I came across the barber problem (again) and while reading it I thought that code.async would be ideal for this kind of problem. Below is the code I have come up with. I think it does the trick but I am not entirely happy with it, for instance the fact that I

Re: Use of volatile! in stateful transducers

2015-01-02 Thread Jörg Winter
So if I'd need that extra performance, say in a private library of transducers not intended to be shared with other Clojure developers, it is perfectly Ok to use a java.lang.Object instead of a volatile, right ? Am Freitag, 2. Januar 2015 15:59:36 UTC+1 schrieb tbc++: > > "As far as I understan

Re: Use of volatile! in stateful transducers

2015-01-02 Thread Jörg Winter
So if I'd need that extra performance, say in a private library of transducers not intended to be shared with other Clojure developers, it is perfectly Ok to use a java.lang.Object instead of a volatile, right ? J 2015-01-02 15:59 GMT+01:00 Timothy Baldridge : > "As far as I understand, the step

Re: How to access nested structures with core.logic ?

2015-01-02 Thread rogergl
I didn't know that featurec supported this. BTW: If anyone is interested. The following works: (def my-data [ {:name 'peter :sales 1200 :nested { :value 123} :age 32} {:name 'paul :sales 200 :ag

Re: Use of volatile! in stateful transducers

2015-01-02 Thread Timothy Baldridge
"As far as I understand, the step-function of a transducer is never(?) accessed concurrently by more than 1 thread." It's actually "one thread at a time". And you're right, stuff like Core.async may bounce a transducer between several different threads, but only 1 thread "owns" it at a given time.

Re: How to access nested structures with core.logic ?

2015-01-02 Thread David Nolen
This is what the `featurec` constraint is for. David On Fri, Jan 2, 2015 at 9:47 AM, rogergl wrote: > I have the following simple core.logic snippet: > > (def my-data [ >{:name 'peter > :some-data { > :some-value: 42 > } > :sales 12

How to access nested structures with core.logic ?

2015-01-02 Thread rogergl
I have the following simple core.logic snippet: (def my-data [ {:name 'peter :some-data { :some-value: 42 } :sales 1200 :age 32} {:name 'paul :sales 200 :age 42} {:name 'mary

Re: How to handle fn args in a macro ?

2015-01-02 Thread rogergl
>>If it were me I'd avoid making 'topic a "magic symbol" and let the user choose a symbol to bind. It'd look something like<< Yes, that is true and I already changed my macro. I just wanted to take little steps towards the final goal. Thanks Roger -- You received this message because you a

Use of volatile! in stateful transducers

2015-01-02 Thread Jörg Winter
Hi, As seen in this example of a stateful transducer... http://crossclj.info/ns/org.clojure/clojure/latest/clojure.core.html#_partition-by ... I am wondering what is the concrete motivation behind using 'volatile!' instead of say a simple (mutable) Java-Object wrapper ? In the partition-all exam