Fork me on GitHub
#clojurescript
<
2016-02-17
>
jimmy03:02:57

@martinklepsch: thanks for pointing out. I will look at it

superstructor04:02:54

if I pass a cljs.core/PersistentArrayMap value from a .cljs file into a defmacro in a .clj file, how can I use that as a clojure.lang.PersistentArrayMap in the macro code please ? e.g. it appears you cannot even call (type) in .clj macros on ClojureScript values, given (defmacro type-of [v] (type v)), (type-of “”) results in java.lang.IllegalArgumentException: No method in multimethod 'emit-constant' for dispatch value: class java.lang.Class ?

jjttjj05:02:43

Hmmm anyone know if it'd be allowed to create a cljsjs package for AmCharts based on this license info? https://github.com/amcharts/amcharts3#license

thheller10:02:37

@superstructor: why is it important for your macro to know which kind of map it is passed? since macro compilation happens in clojure it will always be the clojure kind

thheller10:02:50

the error message you get is because the compiler can't describe a java-class as js

thheller10:02:37

if you want to know if you were passed a map use map?

peeja16:02:58

I'm trying to build the uberjar, but Could not find artifact com.google.javascript:closure-compiler:jar:v20160125 in central

peeja16:02:19

Sure enough, I don't see any v2016* versions

peeja16:02:41

Looks like it got bumped a couple of hours ago?

meow16:02:48

@george.w.singer: Might have more luck on the #C06DT2YSY channel.

dnolen17:02:09

@peeja: yeah you can’t currently build master due to that artifact not being released to Maven yet

dnolen17:02:15

I’m bumped the Closure Compiler mailing list about it

peeja17:02:49

Thanks! I'm on the revision just prior for now.

dnolen17:02:53

they’re usually pretty good about doing them at the same time so I’m not sure what’s up

hueyp18:02:04

I don’t have a strong grasp of the mechanics of this … but lets say I have a function that I want to run pre-client-delivered-clojurescript … e.g. it needs to do a lookup in a 10MB file or something, but the actual outcome is small. Is this something a macro could do or a reader tagged literal?

hueyp18:02:45

e.g. (println (greeting :key)) … greeting might require a lookup in a large table / etc … but ideally the client would just see (println “hello”) compiled

jakehow20:02:06

Hey all, can anyone point me in the right direction of how to attach a custom ring handler to my figwheel setup for a re-frame app? Details here-> https://github.com/bhauman/lein-figwheel/issues/344

jr20:02:22

@hueyp: a macro can look up the value at compile time as long as the lookup table is defined at compile time as well

jr20:02:54

(defmacro greeting [k] (get {:foo “bar”} k “baz”))

jr20:02:10

user=> (println (greeting :foo))
bar
nil

superstructor20:02:35

@thheller sorry I’m a bit confused by ClojureScript macros, in a defmacro unquoted code is resolved to Clojure symbols and evaluated as Clojure right ? I know that if I create a clojure.lang.PersistentArrayMap in the Clojure macro and pass it from Clojure -> ClojureScript it is converted to a cljs.core/PersistentArrayMap ? So if I go the other way and pass a map from ClojureScript -> Clojure macro will it be of type clojure.lang.PersistentArrayMap or cljs.core/PersistentArrayMap ?

hueyp20:02:13

@jr: and that table wouldn’t end up in the client in its entirety? and it could (potentially) be a java specific table? 😜 (thanks)

jr20:02:05

correct by the time the code is compiled the lookup table will not exist

jr20:02:07

user=> (macroexpand '(greeting :foo))
“bar”

jr20:02:54

yeah it can be a java specific table because macros are defined in jvm-clj

hueyp21:02:09

thanks very much @jr !

seanirby21:02:39

hi i'm working through awkay's om next tutorials and I'm stumped on this particular exercise . Am I setting the ident correctly and am I passing properties to it correctly? https://github.com/seanirby/om-tutorials/blob/awkay-tutorial/src/tutorial/om_tutorial/E_UI_Queries_and_State_Exercises.cljs#L11-L13

anmonteiro21:02:21

@seanirby: there's an #C06DT2YSY channel

seanirby21:02:21

anmonteiro: alrighty, i'll go there. sorry about that

peterschwarz22:02:41

Is there a snapshot of the closure library api that is currently available in clojurescript? Trying to figure out what's available and what isn't. Looking at the current closure docs I see all sorts of useful items, but not all of them are available (e.g.` goog.net.Jsonp`)

anmonteiro22:02:34

@peterschwarz: goog.net.Jsonp is definitely available

anmonteiro22:02:49

(:import [ Jsonp])

peterschwarz22:02:12

@anmonteiro: Ok, looks like I just mis-handled that tried to reference it directly via (goog.net.Jsonp. url "callback") and was not seeing it available in the console (like I could XhrIO, which I pulled in via a :require)