ANN Gemini 0.1.0

2013-08-23 Thread Christian Sperandio
Hi, I works for many years in the data matching and I decided to start developing the Gemini Clojure library. This project gives a way to provide functions that searches the likeness of 2 data. More details on the GitHub project page: https://github.com/chrix75/Gemini Christian -- -- You r

Re: ANN clojure.trace.tools 0.7.6

2013-08-23 Thread Softaddicts
Yep... I meant to type clojure/tools.trace. It's Friday, I feel thirsty, I type too fast on my iPad and I am presently visualizing a cold dripping glass full of brown beer... Will get some in a few minutes to lessen the typo errors :) Have a nice week-end, Luc P. > Assuming you meant clojure.

Re: ANN clojure.trace.tools 0.7.6

2013-08-23 Thread Devin Walters
Assuming you meant clojure.tools.trace: https://github.com/clojure/tools.trace, right? On Friday, August 23, 2013 at 1:20 PM, Softaddicts wrote: > Hi all, > > release 0.7.6 is out. It fixes crashes when trace-form(s) encounters a > throwable without a string based constructor. > > This made Cl

ANN clojure.trace.tools 0.7.6

2013-08-23 Thread Softaddicts
Hi all, release 0.7.6 is out. It fixes crashes when trace-form(s) encounters a throwable without a string based constructor. This made Clojure asserts crash the tracing tool but other Java throwables could also make trace-form(s) crash. When doable more information is returned for these odd ca

Re: butlast with reducers

2013-08-23 Thread Jozef Wagner
To continue on my previous post, here is the implementation of map which returns both reducible and (lazy)seqable collection: (defn my-map [f c] (let [coll (clojure.core.reducers/map f c) d (delay (clojure.core/map f c))] (reify clojure.core.protocols/CollReduce

Re: a lazy version of shuffle.

2013-08-23 Thread Christophe Grand
=> (defn lazy-shuffle [v] (lazy-seq (if (seq v) (let [idx (rand-int (count v))] (cons (nth v idx) (lazy-shuffle (pop (assoc v idx (peek v) => (take 10 (lazy-shuffle (vec (range 100 (77 63 37 99 81 73 25 85 35 10) On Fri, Aug 23, 2013 at 1

Re: functional lazy shuffle

2013-08-23 Thread NeedMoreDesu
I've written vector version. As you can make subvectors really fast, and you can take element at index really fast, I just throw out last element at each iteration. (letfn [(vec-throw-out [v i] (pop (assoc v i (get v (dec (count v))] (defn lazy-shuffle [v] (if (seq v) (let [idx

Re: a lazy version of shuffle.

2013-08-23 Thread NeedMoreDesu
(letfn [(vec-throw-out [v i] (pop (assoc v i (get v (dec (count v))] (defn lazy-shuffle [v] (if (seq v) (let [idx (rand-int (count v))] (cons (get v idx) (lazy-seq (lazy-shuffle (vec-throw-out v idx (let [s (range 100) v (vec s)] (ti

Implementing a Scribble-like preprocessor for Clojure

2013-08-23 Thread Bogdan Opanchuk
Hi all, For those who are not familiar with Scribble, it is basically a preprocessor for Racket (a dialect of Lisp) which makes its syntax more concise when working with lots of text, effectively turning it into a template engine (see http://docs.racket-lang.org/scribble/reader.html for detail

Re: butlast with reducers

2013-08-23 Thread Jozef Wagner
To continue on my previous email, here is the implementation of map which returns both reducible and (lazy) seqable object: (defn my-map [f c] (let [coll (clojure.core.reducers/map f c) d (delay (clojure.core/map f c))] (reify clojure.core.protocols/CollReduce

Re: butlast with reducers

2013-08-23 Thread Jozef Wagner
To continue my previous email, here is the implementation of map which is both reducible and (lazy) seqable: (defn my-map [f c] (let [coll (clojure.core.reducers/map f c) d (delay (clojure.core/map f c))] (reify clojure.core.protocols/CollReduce (coll-redu

Re: cgrand's parsley... text offsets ?

2013-08-23 Thread Christophe Grand
Hi, You may be interested in the net.cgrand.parsley.functional-trees and net.cgrand.parsley.views namespaces. you need to pass options :make-node fnode and :make-leaf :fleaf to your parser. Now the result of parse-tree is not a tree anymore but an opaque object (a function). . You can then compu

Re: problem with edn

2013-08-23 Thread Softaddicts
This brings an interesting twist... I am used to build polyglot solutions, our project has been a mix of Java, Ruby and Clojure for a year and a half and prior to that I would mix languages in a project on the fly. However I am not in a mood these days to sacrifice features available in Clojur

Re: problem with edn

2013-08-23 Thread Jim
Hi Kawas, well it is in a sense a client API as I've developed a mini-library for writing board-games and I am using it myself for my chess, checkers, tictactoe etc. The serialization bit is part of the library and not of the games themselves and that's why it should be uniform across games. I

Re: problem with edn

2013-08-23 Thread kawas
Hello Jim, As we know now, that you need data serialization to freeze your chess game and you're not writing any client API :) Have you consider libraries like : - Carbonite - Deep Freeze - Nippy

Re: problem with edn

2013-08-23 Thread kawas
You're right Meikel, I should have not used the term "hack". It is indeed just a solution to serialize data and meta data to edn. As long as you need it, and know how to read it back, I see no misuse. My point was rather on meta data that are not part of the solution domain. If I keep technical

Re: problem with edn

2013-08-23 Thread kawas
Hi Luc, Le jeudi 22 août 2013 21:19:00 UTC+2, Luc a écrit : > > > > Metadata is part of the Clojure environment and part of the value domain > it handles. > Why should it not be transmitted along with the value ? > If the receiver is not written in Clojure it may be questionable an > probably

Re: problem with edn

2013-08-23 Thread Meikel Brandmeyer (kotarak)
Hi, Am Donnerstag, 22. August 2013 17:46:42 UTC+2 schrieb kawas: > > This is indeed a hack and not a best practice > > I disagree. As long as you own the type (or write an application which is self-contained) you are free to define how it is printed. user=> (java.util.Date.) #inst "2013-08-23T07