This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-24
Channels
- # admin-announcements (1)
- # alda (22)
- # aws-lambda (1)
- # beginners (9)
- # boot (17)
- # cider (39)
- # cljs-dev (10)
- # cljsjs (1)
- # cljsrn (14)
- # clojure (88)
- # clojure-android (1)
- # clojure-dev (9)
- # clojure-india (1)
- # clojure-russia (271)
- # clojure-spec (5)
- # clojure-uk (101)
- # clojurescript (74)
- # clojutre (11)
- # component (2)
- # cursive (24)
- # datascript (7)
- # datomic (9)
- # dirac (13)
- # docs (3)
- # emacs (4)
- # garden (21)
- # hoplon (9)
- # jobs-rus (5)
- # lein-figwheel (3)
- # leiningen (13)
- # luminus (12)
- # off-topic (1)
- # om (24)
- # onyx (84)
- # proton (3)
- # re-frame (39)
- # reagent (21)
- # rethinkdb (1)
- # slack-help (10)
- # specter (4)
- # test-check (1)
- # untangled (35)
- # yada (2)
@jasonjckn: requiring the cljs.js
namespace gives you that: http://cljs.github.io/api/cljs.js/
yeah this was the big release last year that changed the version scheme and added self-hosting: http://cljs.github.io/news/1.7.28
meh, @dnolen my mistake (or rather Sublime's). Had saved the .cljs file in the wrong place. OpenJDK 9 works fine so far.
@potetm would you like to try https://github.com/Respo/respo/wiki/Quick-Start I used React.js(in CoffeeScript) and Reagent before, and made this for my own projects. Not as powerful as React, but a lot simpler.
Is there any real reason not to use the :hints
feature in cljs-devtools? It is disabled by default but I can't see any real downsides to activating it https://github.com/binaryage/cljs-devtools/blob/master/docs/faq.md#what-is-the-hints-feature
Isn't it for this reason, written in link you referred? > This is expected to work only with :optimizations none compiler mode and it is disabled by default because it relies on monkey patching
@jiyinyiyong: Yeah, but how do I know if this is a problem in practice?
@curlyfry you know when weird stuff starts happening to your code 🙂
I think it’s disabled because it’s too invasive/dangerous to be on by default, perhaps it will be on by default later once it gets more usage
@danielcompton: Cool, that seems reasonable
;; Although lists are sequences, they are not keyed sequences.
;; `contains` should not be used for lists.
(contains? '(1 2 3) 1)
;;=> false (Clojure = 1.1)
;; IllegalArgumentException (Clojure >=1.5)
If like me you wanted to find a value in a collection and read this article then you'll need to find an alternative. So instead of:
(contains (1 2 3) 1)
I used:
(some #(= 1 %) (1 2 3))
I hope that helps @nxqd
I'm having trouble using cljs.core/destructure. It seems that my REPL and code do not know of it, even if Cursive can jump to the correct source in cljs.core
.
my-repl> (destructure '[:asdfsdf "lol"])
---- Compiler Warning on <cljs form> line:1 column:2 ----
Use of undeclared Var my-namespace/destructure
1 (destructure '[:asdfsdf "lol"])
^---
---- Compiler Warning ----
#object[TypeError TypeError: Cannot read property 'call' of undefined]
nil
my-repl> (cljs.core/destructure '[:asdfsdf "lol"])
---- Compiler Warning on <cljs form> line:1 column:2 ----
Use of undeclared Var cljs.core/destructure
1 (cljs.core/destructure '[:asdfsdf "lol"])
^---
---- Compiler Warning ----
#object[TypeError TypeError: Cannot read property 'call' of undefined]
nil
@am-a_metail I just found out the problem, I just need to add (:refer-clojure :exclude [get])
. There must be some change in clojurescript compiler. Normally they they returns a warning, this time it's an error :-
Oh right - thanks @nxqd
I've tried :require-macros
, :require
ing cljs.core and other silly stuff. No dice.
Couldn't google any similar problems, but maybe someone in here has run into the same thing?
@reefersleep destructure
is in the macro ns, it’s a function in Clojure, there’s no way to get at it
regarding destructure
, is there a cleaner way to do:
(defn- gensym? [v]
(re-matches #"(map|first|seq|vec)__\d{1,10}" (name v)))
#? (:clj (defmacro when-all-let
"Like `when-let` but executes `body` when all the destructured bindings are true"
[bindings & body]
(let [dst (destructure bindings)
syms (->> dst (filter symbol?) (remove gensym?) set vec)]
;; cannot reuse `dst` to make something like
;; `(let* ~dst ...)
;; as it contains Clojure-specific types (e.g. clojure.lang.PersistentHashMap)
;; which won't work when expanded in Clojurescript
`(when-let [~(bindings 0) ~(bindings 1)]
(when (every? (comp not nil?) ~syms)
[email protected])))))
@dnolen: thank you for the concise answer!
@dm3: Interesting problem. I don't think I'm able to give a good answer 🙂
In clojurescript - can I defn
within say, an initialisation func in order to avoid some state sitting about. e.g. (defn init [config], (defn foo [x] (...closed around config...) )
Perhaps having declare
d foo previously
You could return a function from init
for example (defn init [] (fn [] :foo ))
then assign it foo
(def foo (init))
@dnolen that contains?
bug is a regression introduced by the :rename
patch
I’ve already got a fix
@nxqd thanks for reporting, your bug should go away with this patch: http://dev.clojure.org/jira/browse/CLJS-1763
@anmonteiro applied thanks
@alpheus people use standard JS headless testing for that, Selenium or Slimer (I would personally limit my usage of either even if I needed it for some reason)
@am-a_metail I would not do that, nesting defn is not only not idiomatic it’s nothing we ever test
What methods operate on event returned by goog.events EventType/SCROLL, I would have assumed .-x and .-y?
In hindsight, it looks like WASD took the liberty to modify the SVG to make the line thickness larger (perhaps to make it show up). Cool, I suppose !
@mfikes: @hlship was looking into what it would take to get a bunch of keys printed with the Clojure logo, it seemed like the price would be pretty reasonable for a group buy of some sort. Last I heard the main issue was dealing with the image copyright for something more than a one off.
I’m still pursuing that, but the people who can make the decision, especially @richhickey, are on PTO.
Yeah, that would be very nice if it happened. Especially if it involves something better than pad printing, or perhaps if it ends up being a bit more affordable. (A one-off key like the above is USD 10 — USD 15.)
At about 50 keys, it drops below $2/key, if memory serves. I’m looking at DSA keycaps for my Ergodox.
@hlship: Where were you looking at printing them from?
Actually, the breakdown is 100 keys = $2.14 each. There’s a whole range for prices based on order quantity.
Yeah, I've got another idea for a keycap as well that I may end up pursuing if the Clojure or CLJS ones don't go through. Not quite as general purpose but I doubt the copyright side of it will be as much of an issue. Thanks for the info.
@mfikes: that is an SVG resize error...
they tried to downscale the SVG, I’ve seen that artifact before, haha
because the parens are paths defined with line thickness, the thickness doesn’t scale correctly
we should fix that, filing an issue
will do, thanks
@reefersleep: re: lack of cljs.core/destructure… next time you can ctrl+f search the http://cljs.github.io/api to check availability of symbols. special care is taken to list only clojure macros that are only available to cljs
speaking of http://cljs.github.io, who owns that? I would like to make a pull request but I don’t really understand gh pages
@chris: let me know if you have questions, the https://github.com/cljs/site repo is the one that generates the site
if you want to edit the api pages, the edit link is at the bottom of every “details” page
thanks. I just noticed that it was trying to load a font from an http site, but an https site exists for it
cool, glad to accept pr
re-frame 0.8.0, does it ship with :http fx handler? From a quick test and looking at the source, my guess is no, but want to ask just in case i missed something.
@mokr it is a separate plugin https://github.com/Day8/re-frame-http-fx