Fork me on GitHub
#clojurescript
<
2019-07-03
>
maxp08:07:09

that is correct in ClojureScript

cljs.user=> (for [x [1]] :a :b)
(:a)

😮 4
maxp08:07:18

but should be an error? Wrong number of args (3) passed to: clojure.core/for

plexus15:07:41

what's the right require/import syntax to be able to call a static method from a Closure class? I'm trying to call goog.date.DateTime/fromIsoString and whatever I'm trying isn't working 🙂

thheller15:07:43

aliasing those can be tricky but (js/goog.date.DateTime.fromIsoString ...) should always work when coupled with (:import [goog.date DateTime])

thheller15:07:02

or (:require [goog.data.DateTime :as DateTime]) + (DateTime/fromIsoString ...)

thheller15:07:32

but the require style doesn't allow using (DateTime. ...) directly after

plexus15:07:43

hmm I though I tried the require + DateTime/fromIsoString option, I'll try again or use the js/ route. Thanks!

plexus15:07:58

seems the problem is that function doesn't exist... guess it's a different version of GCL

thheller16:07:49

oh yeah. CLJS depends on a rather old version of the GCL

dnolen16:07:17

@plexus for static method calls like that you want :import as @thheller said

plexus16:07:10

So import and then the full js/... form?

dnolen16:07:13

DateTime/fromIsoString will work with :import

✔️ 4
mikerod19:07:32

Can you use ^js in plain cljs for extern inference?

mikerod19:07:49

I can’t remember and can’t find doc

mikerod19:07:16

I know you can do like ^js/Foo and ^js/Foo.Bar

dpsutton19:07:37

unless that’s a bit different than what you’re asking

mikerod19:07:36

@dpsutton looks like the same sort of thing that I’m asking. I just wasn’t sure if that was supported syntax to just say “make an extern for some untyped obj”