Re: (doseq/lazy/interop)? problem, different behaviour when adding a println

2017-04-24 Thread Alan Thompson
Having not gone through your code in detail, I would suggest replacing `map` -> `mapv` to make it an eager operation so that state updates (i.e. ` next-states`) occur right away. The presence of laziness where it is not needed or expected (especially in Java interop code) can cause problems with t

Re: (doseq/lazy/interop)? problem, different behaviour when adding a println

2017-04-24 Thread Alan Thompson
Unless prevented by outside considerations, it might also be cleaner/simpler to copy all inputs from Java -> Clojure, do all the algorithm work in Clojure, then copy all outputs back from Clojure -> Java. I'm looking specifically at `java-memory-map`, but would also replace native java stuff like `

Re: (doseq/lazy/interop)? problem, different behaviour when adding a println

2017-04-26 Thread Leon Grapenthin
Hi Lucas, lazy sequences, as the one produced by the map/filter construct, aren't realized at once. I. e. they are returned as a sequence, but your map and filter lambdas are only invoked once somebody looks at whats in the sequence. Usually, steps are evaluated in chunks of size 32. Your filt