Fork me on GitHub
#clojurescript
<
2017-01-08
>
arohner00:01:49

in CLJS, if thereโ€™s an uncaught exception in a go block, taking from the channel returns nil. Is that intended? Is there a workaround other than try/catch inside the go block?

jtmarmon00:01:14

Is there a difference between react hot loader and figwheel in terms of developer UX, or are they basically the same thing implemented in two different languages?

ejelome00:01:47

they are the same, only that figwheel afaik started the autoreload + keeping state

dpsutton04:01:21

is def a macro in cljs.core?

dpsutton04:01:52

I'm investigating a bug in completion for CIDER in cljs and the cljs-tooling isn't showing a definition for def in cljs.core

dpsutton04:01:06

> (keys (a/public-macros 'cljs.core))
(unsafe-bit-and macroexpand unchecked-remainder-int when-first cond->> bit-set import-macros while satisfies? unchecked-subtract-int ns-unmap bit-shift-right aget specify vswap! caching-hash bit-shift-left coercive-not dec < this-as .. delay unchecked-negate simple-benchmark unchecked-inc-int js-str bit-shift-right-zero-fill implements? goog-define pos? specify! if-not alength bit-xor doseq unsigned-bit-shift-right neg? unchecked-float undefined? deftype mask when-let divide coercive-boolean <= if-some * min lazy-seq js-delete truth_ js-debugger let -> coercive-not= doto areduce double bit-and-not unchecked-add-int fn short unchecked-double string? js-arguments unchecked-multiply-int as-> when-not when int > keyword? unchecked-multiply gen-apply-to some->> unchecked-dec defn float js-in es6-iterable amap declare - hash-set or extend-type macroexpand-1 bit-test defmethod time zero? unchecked-dec-int memfn js-obj nil? extend-protocol cond-> dotimes bit-and reify instance? load-file* defonce unchecked-add identical? unchecked-divide-int defn- defprotocol unchecked-subtract assert true? array letfn / bitpos bit-or vector >= loop bit-flip js-mod with-out-str condp cond some-> ns-interns for binding array-map unchecked-byte defmacro unchecked-short inc with-redefs bit-clear list + aset defmulti str coercive-= hash-map if-let false? case exists? bit-not byte max == lazy-cat comment copy-arguments unsafe-cast defrecord make-array unchecked-negate-int unchecked-inc and number? js-comment symbol? when-some unchecked-char ->> js-inline-comment)
> 

dpsutton04:01:39

long and short is that def isn't in that list for some reason

dpsutton04:01:56

is it maybe an alias or something?

richiardiandrea04:01:11

@dpsutton macros are defined in clj files usually so (and take it with a pinch of salt waiting for better answers) you could try clojure.core instead

richiardiandrea04:01:00

Also namespace inspection for ClojureScript differs a bit

dpsutton04:01:15

this is when getting info for clojurescript objects

dpsutton04:01:24

in a clojurescript repl

dpsutton04:01:42

cljs knows what def is, ie, (def x 1) works, but when asking the tooling, it doesn't know what def is

dpsutton04:01:56

the tooling seems to know the other macros i just didn't see anything about this one

dpsutton04:01:30

unless i missed your point ๐Ÿ™‚

richiardiandrea04:01:04

I don't remember having to handle def as a special case when working with cljs-in-cljs but I don't remember very well now ๐Ÿ˜€

dpsutton04:01:43

oh well. i've got an issue raised and some info for them

dpsutton04:01:54

just wondering where (defmacro def ...) is ๐Ÿ™‚

dpsutton04:01:05

might be too early in the bootstrap process for it to be defined in cljs?

richiardiandrea04:01:39

Maybe yes I don't see it in the namespace and now I am curious too ๐Ÿ˜€

richiardiandrea05:01:24

Probably it is something defined very early but I am surprised that it is not interned

richiardiandrea05:01:36

Left some info in the issue

richiardiandrea05:01:12

Probably you need access to the compiler state

richiardiandrea05:01:26

Unfortunately replumb needs a bump to the latest compiler version but you could use its replumb.ast in order to inspect it

darwin13:01:40

@arohner this is by design, there might be multiple valid strategies how to handle errors in go blocks, for example you might want to return them as special error values into the channel, or you might want to establish a special side channel for reporting errors, or you might simply eat them and close the channel (the default behaviour), etc. I would recommend you to define your own go macro wrapper which would implement a strategy of your liking, for example wrapping go body in try-catch, or look at <? people seem to use quite often: https://gist.github.com/vvvvalvalval/f1250cec76d3719a8343 https://gist.github.com/metametadata/9f1c205b8092d7b2726f (see links in comments)

mfikes15:01:10

@dpsutton def is a special form

dpsutton16:01:56

thans mfikes

mfikes16:01:40

Two easy ways to see this: (doc def) and (special-symbol? โ€˜def)

gfredericks18:01:20

is let a macro in cljs?

richiardiandrea18:01:46

@mfikes thanks did not know about special-symbol? ๐Ÿ‘

selfsame18:01:35

how can I configure class paths for node-cljs (lumo)

selfsame18:01:10

i.e. leins :source-paths ["src" "test"]

notanon18:01:15

How do I get the cljs compiler to generate my externs for me? I can't find David Nolen's gist with instructions.

selfsame19:01:19

ah ok both lumo and planck have a cli flag -c src:tests