Clojurians
#cljs-dev
<
2016-08-09
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

anmonteiro14:08:28

wondering if there’s a typo in that line

anmonteiro14:08:35

reloads reloads -> reload reloads

dnolen16:08:28

@anmonteiro: hrm probably but I defer to @mfikes

anmonteiro16:08:48

@dnolen: should we hard error in CLJS or behave like Clojure in the following example?

boot.user=> (require '[clojure.set :rename {intersection foo}])
nil
boot.user=> (foo #{1 2} #{2 3})

clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(/var/folders/d_/b1bghypn20lgq2b24v7396pr0000gn/T/boot.user50214679673122449.clj:1:1)
             java.lang.RuntimeException: Unable to resolve symbol: foo in this context

anmonteiro16:08:59

case is rename a symbol that we don’t refer

anmonteiro16:08:15

seems like it's a no-op in Clojure

anmonteiro16:08:31

I’m leaning towards mimicking Clojure: if symbol is not referred, don’t rename. but don’t hard error

mfikes16:08:27

@anmonteiro: Seems like reloads reloads is a fairly cut-n-dry typo—vintage 1 year. To be sure I built and ran all of Planck’s tests with the typo fixed and they pass.

anmonteiro16:08:18

@mfikes: sorry I don’t know what that means, not a native English speaker :slightly_smiling_face:

anmonteiro16:08:27

does it mean innocuous?

mfikes16:08:02

Oh. “cut-n-dry” means… fairly easy to see that it is the case without much deep investigation.

anmonteiro16:08:25

yeah, that’s why it jumped to sight

mfikes16:08:56

But, yes, the typo is also innocuous in that it involves a truthy value that likely doesn’t have very bad consequences apart from perhaps reloading when not needed, I’d guess.

mfikes16:08:18

My take on your :rename example, is that high-fidelity with Clojure is inherently good.

dnolen17:08:46

@anmonteiro: ns form problems are usually hard errors already

anmonteiro17:08:27

@dnolen: right, but shouldn’t we mirror Clojure in this particular case?

anmonteiro17:08:51

IMHO, it’s not wrong to (require '[clojure.set :rename {intersection foo}])

anmonteiro17:08:05

makes sense to be a NOP

dnolen17:08:25

this just sounds like Clojure being lax here for no particular reason

dnolen17:08:30

I’m fine with a hard error

dnolen17:08:40

this is the kind of thing users will mess up and then scratch their heads

anmonteiro17:08:11

@dnolen: gotcha, hard error it is then. Patch will be ready after this little change

dnolen17:08:18

cool thanks!

anmonteiro18:08:17

does this approach look better?

anmonteiro18:08:38

used the suggested keys :rename and rename-macros to store renames

dnolen18:08:44

@anmonteiro: it does look better, it does seem though we might want to think about macro inference here as well? (or does this patch already handle that?)

anmonteiro18:08:07

@dnolen: already handled

anmonteiro18:08:17

for JVM & Bootstrap :slightly_smiling_face:

dnolen18:08:22

k good, I will have to take a closer look then!

anmonteiro18:08:23

tests for each too

anmonteiro18:08:35

@dnolen: OK I’ll assign it to you then, thanks!

dnolen21:08:19

please test

anmonteiro21:08:33

@mfikes: appreciate you giving it a spin too in bootstrap. I think I covered it there but I'm not too familiar with cljs.js

mfikes21:08:02

@anmonteiro: Absolutely. Thanks for sorting through that feature!

anmonteiro21:08:25

It was a fun one

dnolen21:08:49

also added a new compiler option for newcomers, :browser-repl true it’s mostly there to make the Quick Start simpler

dnolen21:08:10

but also will hopefully give people an idea about how to use :preloads

anmonteiro21:08:20

@dnolen: what’s your opinion on this one? http://dev.clojure.org/jira/browse/CLJS-1474

anmonteiro21:08:54

I discussed it briefly with @mfikes about putting that under a flag so that e.g. spec can define def

anmonteiro21:08:08

I think the problem arised with bootstrap

dnolen21:08:45

@anmonteiro: not excited about a flag for this

anmonteiro21:08:56

I didn’t mean a compiler option

dnolen21:08:16

Also this is a really minor issue, Clojure itself doesn’t warn about it at all

anmonteiro21:08:36

I agree. Just asking because of the feedback I got

anmonteiro21:08:45

maybe worth holding off on this one for a while

dnolen21:08:49

yes I think so

darwin21:08:04

just today unaware of it, I got burnt by something similar :wink: wanted to name my macro set! and use it in cljs code, it was puzzling why refer-macros was ignoring me... https://github.com/binaryage/cljs-zones/blob/master/src/lib/zones/core.clj#L119

mfikes22:08:55

@anmonteiro: The :rename feature is working great for me downstream in Planck. Awesome! (I’ve updated Planck master to build with ClojureScript master.)

anmonteiro22:08:12

@mfikes: great news

anmonteiro22:08:48

Thanks for taking it for a spin so promptly :-)