Re: feedback on side project

2015-04-14 Thread myguidingstar
On Tuesday, April 14, 2015 at 2:53:16 AM UTC+7, Sebastian Bensusan wrote: > As a side notes, in Lisp it is convention to append "!" to those functions > that have side-effects (i.e. mutate state). A good candidate would be > `reset-games!`. > This is also an evidence that Andrea hasn't read th

[ANN] Synthread with Clojurescript support

2015-03-24 Thread myguidingstar
Hi all, I've just ported this very interesting library to Clojurescript (and Boot build tool, too) Hope you all enjoy it! https://github.com/myguidingstar/synthread -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gr

Re: Please help making this tiny macro work with Clojurescript

2015-03-23 Thread myguidingstar
Oh silly me. It's just .val should be replaced with more portable version .-val Problem resolved! -- 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 are mode

Re: Please help making this tiny macro work with Clojurescript

2015-03-23 Thread myguidingstar
It turns out that this code works in Clojure: (let [x (clojure.lang.Box. 1)] (set! (.val x) 2) (.val x)) while this one failed to compile in Clojurescript (just .cljs, no macro involved): (let [x (cljs.core/Box. 1)] (set! (.val x) 2) (.val x)) Box is already defined as mutable in Clojuresc

Please help making this tiny macro work with Clojurescript

2015-03-23 Thread myguidingstar
I'm porting this library to Clojurescript. Everything is ok except this `for` macro: https://github.com/LonoCloud/synthread/blob/master/src/lonocloud/synthread.clj#L112 When required and compiled with Clojurescript, the above `for` yelled at me: clojure.lang.ExceptionInfo: set! target must be a

Deterministic macro expansion for Clojure?

2015-03-22 Thread myguidingstar
Hi all, I wonder if there is any way to make macro expansion in Clojure deterministic. That would be useful in unit tests. Something like this: ``` (defmacro lol [] `(let [a# 1] (inc a#))) (with-predictable-gensym-starting-from-zero (macroexpand '(lol)) ;; => `(let [a0 1] (inc a0)) ``` -- Y

reduced doesn't work inside reductions

2014-11-28 Thread myguidingstar
(reduce (fn [acc x] (if (> acc 10) (reduced acc) (+ acc x))) 0 (range 100)) ;; => 15 (reductions (fn [acc x] (if (> acc 10) (reduced acc) (+ acc x))) 0 (range 100)) ;; thows

[ANN] Fence - effortless way to avoid manual extern files when doing javascript interop from Clojurescript

2014-11-10 Thread myguidingstar
This library provides a `..` macro that can be used in place of its counterpart in `clojure.core`. Use it for all your javascript interop forms to avoid adding extern files manually. More details here: https://github.com/myguidingstar/fence Hopefully this will save people some extra keystrokes