Fork me on GitHub

I'm having some trouble with hickory, does anyone have experience with it here?


@gabehollombe: interesting, thanks. There are so many functions to learn 😛


so... it would make more sense for iterate to be called iterations


hey @doddenino: hickory uses jsoup, which many have experience with. do you have more details about the problem?


@polymeris: I don’t think so, because you’re not interested in the value of each iteration when you call iterate — you just want it to iterate, yeah?


reductions is so-named because you want all the reductions. (compare vs reduce)


@gabehollombe: but iterate returns a seq of the intermediate values, no?


it should just return the last... if you go by the name


ah, I see what you’re getting at.


I think I saw one of your talks... are you involved in phaser?


funny, I am currently working with pixi and thought about going with phaser, first


trying to wrangle it into a form that works with FP/cljs


@polymeris: not involved with, but I have given Phaser talks! 😃


Yeah, use Pixi if you just want rendering, Phaser if you want more of a game framework. Although a.k.a. Lazer, will have their own renderer (no longer using Pixi) if I understand it right


@gabehollombe: either way (phaser or pixi), I have found it hard to getting it to work with cljs. The interop works ok, but it's just not designed with FP in mind. Any tips?


E.g... where should I store all that state pixi generates?


@jonahbenton I have a div containing spans. These spans can contain text, or another span containing text. I'm trying to get the text. I tried all the combinations of descendant, child, and, or, but I can only get one of the two span times at a time, not both together 😞


@polymeris: Alas, I haven’t done any FP style games yet


um, is there a way to specify the argument order of a function when using -> or ->>?


i have a function (-> arg (fn1 arg ..) (fn2 arg0 arg1))


having some protocol confusion here


got this code:

(defprotocol ApiResource
  (resource-url [self] [self opts]))

(defn _resource-url
  "Construct URL for resource from `:id` and `:resource-type` keys."
  ([subject {:keys [base-url]}]
   (if-let [path (_resource-url subject)]
     (construct-full-url path base-url)))

   (let [id (:id subject)
         type (:resource-type subject)]
     (if (and id type)
       (str "/" type "/" id)

(extend-type java.lang.Object
  (resource-url [self] (_resource-url self))
  (resource-url [self opts] (_resource-url self opts)))

(resource-url {}) ;; expect nil, get ArityException


exception I get (with variation in the random numbers)

Unhandled clojure.lang.ArityException
   Wrong number of args (1) passed to: core/eval27713/fn--27714

              429  clojure.lang.AFn/throwArity
               32  clojure.lang.AFn/invoke
                      core.clj:   46  hypertension.core/eval27478/fn/G
                          REPL:    1  hypertension.core/eval27717


The way I see it I've got single-arity implementations of everything, so I don't see what I've messed up


I believe that should look something like this:

(extend-type java.lang.Object
    ([self] (_resource-url self))
    ([self opts] (_resource-url self opts))))


is there a function for something like this


(when (test-if-thing-exists) test-if-thing-exists)


presumably test-if-thing-exists on its own would be enough?


yea, but i want to do something with it and then return the value


but i don’t want to call test-if-thing-exists twice


if-let and when-let maybe


will look those up, thanks!

Drew Verlee18:01:04

In the following code from this excellent blog post (, the author is trying to convey an idea about commute. That the commute function will update the ref based on the value of the ref it reads 'at commit'. I'm I correct in assuming however, that in this case commute is meaningless/usless because we're in a single thread? As in the first log-deposits will always happen before the second'. Or put another way, it seems like commutes have not purpose unless your using multiple threads. Are dosync or commute starting background threads? I thought you would need to use future explicitly for this to happen.

Drew Verlee18:01:59

I'm also having trouble understanding why the commute function is called 'twice' as explained here: What does it mean >and returns the in-transaction-value of ref. why not commit this value at that point. Finally, I don't understand how the correct value is resolved using commute if their all potentially using 'old values' of ref. (which is what it looks like is happening the example at the end of this blog:

Drew Verlee18:01:32

+ 100 cool points bounty.


I'm getting some Json using cljs-ajax but the map has "string" intead of :key. How do i get key-keys instead of string keys


If I ask i figure it out immediately after asking... Nvm

Drew Verlee20:01:21

Maybe the second 'commit'time' computation is 'usually less expensive' because its assumed large parts of the function are already evaluated?

(+ x 1 (+ 1 1)) ;; in-transaction
(+ x 1 2) ;; at commit time


Hello, I'm trying to teach myself clojure by transforming nested maps into CSS code but stuck with basic function composition...

(def css1 {"body" {:background-color :#d0e4fe}
           "p"    {:font-family      "Times New Roman"
                   :font-size        :20px}})

(defn o [[property value]] 
  (str (name property) " : " (if (keyword? value) (name value) (str "\"" value "\"")) ";"))
(defn oo [block] 
  (clojure.string/join "\n" block))
(defn ooo [[selector block]] 
  (str selector " { " block " }"))
(defn oooo [nestedmaps]
  (clojure.string/join "\n" nestedmaps))
do you think my approach is totally flawed?


are go-loops for async going to necessarily have side-effects? All the examples I see are like this:

(go-loop []
  (let [fun (<! output-chan)]
    (println "check")
    (println (get fun 0))
    (println (get fun 1))

Drew Verlee23:01:32

@tmtwd: from my very naive perspective, no, your go loops don't necessarily have to have side effects. The ones your viewing probably do so they can show you how things are being executed.