This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-21
Channels
- # alda (1)
- # bangalore-clj (1)
- # beginners (7)
- # boot (88)
- # carry (2)
- # cider (8)
- # cljs-dev (60)
- # cljsjs (2)
- # cljsrn (45)
- # clojure (255)
- # clojure-belgium (5)
- # clojure-boston (1)
- # clojure-dusseldorf (3)
- # clojure-greece (49)
- # clojure-italy (10)
- # clojure-russia (30)
- # clojure-spec (78)
- # clojure-uk (11)
- # clojurebridge (1)
- # clojurescript (80)
- # cursive (14)
- # datomic (33)
- # defnpodcast (4)
- # devcards (2)
- # dirac (15)
- # editors (23)
- # emacs (5)
- # events (11)
- # funcool (1)
- # hoplon (1)
- # juxt (1)
- # luminus (2)
- # mount (7)
- # off-topic (15)
- # om (152)
- # om-next (2)
- # onyx (17)
- # parinfer (1)
- # proton (38)
- # re-frame (35)
- # reagent (110)
- # rum (3)
- # spacemacs (3)
- # specter (51)
- # test-check (2)
- # testing (5)
- # untangled (234)
users are just going to write (:require [clojure.test :as test :refer […])
and be done with it
then went and read about project jigsaw only to learn they aren’t doing anything for version conflicts in JVM land =\
@spieden we leave the task of automatic conflict resolution to some future alien civilization
@anmonteiro Thanks!
vars also only exist in a highly limited fashion and it’s best to have no expectations
(the story for bootstrapped is different, but I’m assuming you’re not asking about that)
it’s a provided self-hosted option for people who don’t care about greatly increased code size
This may sound stupid but is defmacro
in ClojureScript a thing now? I'm looking at spec.cljc in the ClojureScript repo and it has defmacro
without a surrounding reader conditional. How does that work?
@jannis it’s meant for self-hosted CLJS
you can read a bit more about that here: http://blog.fikesfarm.com/posts/2015-12-18-clojurescript-macro-tower-and-loop.html
there are some other posts of interest re: macros in that blog too
@anmonteiro, @dnolen: Ok, makes sense
is it expected when a let binding name shadows a js global, the global becomes inaccessible with js/...
?
i can see from the generated source why it happens, but it surprised me
@eyelidlessness that is not expected, I would expect js/
to work regardless
(defn simple-repro []
(let [location (str js/location.pathname)]
location))
calling that throws TypeError: Cannot read property 'pathname' of undefined
though i'd expect it would not throw with advanced compilation
(this is with whitespace optimization only)
@eyelidlessness not sure what you would expect
like i said, i understood why it happened.
like i said, i understood why it happened.
it's at least surprising; I also didn't realize that js/window
may fail in a let
:thumbsup:
a warning would go 95% of the way of removing the surprise yes!
makes sense. i may take a look at it.
agree makese sense
a few people understand how warnings works, and how we could check js/foo
conflict with a local
i'm gonna take some time looking through the codebase and see if i can't grok how to do it, before i ask any questions.
@pesterhazy yes it’s the same problem - but wasn’t interested in the proposed solution
i agree. i would prefer less name mangling, not more 🙂
@eyelidlessness @pesterhazy feel free to open a minor enhancement ticket in JIRA
looks like there's some special casing already for some common globals: https://github.com/clojure/clojurescript/blob/92459050162fce53312d9df7d7b5c703d2d992c2/src/main/clojure/cljs/analyzer.cljc#L585
@pesterhazy yes but unrelated to this enhancement
one minute (eternity) while i relearn how to use jira
wouldn't throwing an error be even better than a warning? Is there any situation where you want to use js/location
to refer to a let binding?
just a thought
makes sense to me.
I added a bunch of newbie friendly tasks today http://dev.clojure.org/jira/secure/IssueNavigator.jspa?mode=hide&requestId=10616