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
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
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
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
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
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
(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
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