dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
martinklepsch 2017-01-05T17:09:46.001306Z

Hey πŸ™‚

martinklepsch 2017-01-05T17:11:58.001307Z

CLJS DevTools Error me.cljs$core$IMapEntry$_val$arity$1 is not a function
I’m getting an exception like this one from the reporting stuff

martinklepsch 2017-01-05T17:19:34.001308Z

It’s almost certainly caused by my wonky custom type though πŸ˜„

2017-01-05T17:20:08.001309Z

@martinklepsch I would need to see full stack trace

2017-01-05T17:20:55.001310Z

cljs-devtools uses clojurescript printing machinery, so it can easily raise exceptions, for example when printing something with buggy IPrintWithWriter methods

2017-01-05T17:22:38.001313Z

but it should not break you much, because the exception guard should catch exceptions raised during printing: https://github.com/binaryage/cljs-devtools/blob/master/src/lib/devtools/formatters/core.cljs#L66

martinklepsch 2017-01-05T17:24:24.001315Z

(js/console.log 'vals (type (vals {:a 1 :b 2})))
(js/console.log 'check-in-vals (type (vals (org.martinklepsch.cc-set/set-by :id {:id 1} {:id 2}))))

(js/console.log 'vals (vals {:a 1 :b 2}))
(js/console.log 'check-in-vals (vals (org.martinklepsch.cc-set/set-by :id {:id 1} {:id 2})))       
So both of these return ValSeqs but the last log statement causes the above exception

2017-01-05T17:26:19.001320Z

what happens if you do (print (vals (org.martinklepsch.cc-set/set-by :id {:id 1} {:id 2}))) ?

2017-01-05T17:26:28.001321Z

do you get the same error?

2017-01-05T17:26:49.001322Z

this looks to me as a bug in cljs.core.ValSeq.cljs$core$IPrintWithWriter

martinklepsch 2017-01-05T17:27:08.001323Z

same issue

2017-01-05T17:27:26.001324Z

print should not have anything to do with cljs-devtools, can you confirm from the stack trace?

martinklepsch 2017-01-05T17:27:43.001325Z

this is my IPrintWriter impl:

IPrintWithWriter
  (-pr-writer [coll writer _]
    (let [items (string/join " " (map pr-str (seq coll)))]
      (-write writer (str "#CustomComparatorSet{" items β€œ}"))))

martinklepsch 2017-01-05T17:28:06.001326Z

yeah, no devtools in stacktrace

martinklepsch 2017-01-05T17:30:03.001327Z

I’ll investigate. Sorry for the confusion πŸ™‚

2017-01-05T17:30:04.001328Z

cannot reason about that code, coll seems to have something inside which cannot be processed by pr-str

2017-01-05T17:30:57.001329Z

use that print snippet and stop devtools on exceptions

2017-01-05T17:31:02.001330Z

investigate the callstack