This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-15
Channels
- # aws (1)
- # beginners (6)
- # boot (25)
- # cider (30)
- # cljs-dev (50)
- # cljsrn (45)
- # clojure (98)
- # clojure-austin (5)
- # clojure-czech (1)
- # clojure-dev (21)
- # clojure-dusseldorf (29)
- # clojure-germany (2)
- # clojure-greece (117)
- # clojure-italy (2)
- # clojure-nl (4)
- # clojure-russia (26)
- # clojure-serbia (10)
- # clojure-spec (123)
- # clojure-turkiye (1)
- # clojure-uk (27)
- # clojured (13)
- # clojurescript (57)
- # core-async (18)
- # cursive (13)
- # datomic (20)
- # defnpodcast (16)
- # emacs (8)
- # events (2)
- # figwheel (3)
- # instaparse (1)
- # jobs (3)
- # jobs-discuss (39)
- # klipse (9)
- # lumo (100)
- # mount (1)
- # numerical-computing (1)
- # off-topic (22)
- # om (34)
- # onyx (17)
- # pedestal (1)
- # perun (29)
- # re-frame (60)
- # reagent (16)
- # remote-jobs (8)
- # rethinkdb (6)
- # ring-swagger (19)
- # rum (1)
- # slack-help (1)
- # specter (3)
- # untangled (1)
- # yada (17)
i'm confused about how NaN
works in cljs
(def a NaN)
NaN
(if a :foo :bar)
:foo
(if NaN :foo :bar)
:bar
That can't be right
js works like this
var a = NaN;
undefined
if (a) { 1; } else { 2; }
2
NaN is truthy in cljs
so then why (if NaN :foo :bar)
?
being :bar
oh, js/NaN
works differently it seems
Yeah that's it
NaN is not a special symbol in cljs
And in clojure, only nil
and false
are falsey.. in js... well.. http://stackoverflow.com/questions/19839952/all-falsey-values-in-javascript
@shader I guess splitting projects into backend and frontend ones is fine. And Bidi routes then can still live in a common .cljc file visible by both projects, so there's no need to serve them dynamically via server API.
if you hava an SPA mounted at /foo
, you can just serve /foo/*
to the same static route on the server
don't see a need for the server to know about client routes
ah that's what @metametadata said, sorry 🙂
@pesterhazy well, not exactly the same 🙂
actually I too mostly use /foo/*
approach so that server knows nothing about SPA routes. It's easier, but means 404 pages are generated by SPA.
Hi, we have a js codebase, and I’m thinking about the possibility to use clojurescript in some parts. Is it possible to use immutable datastructures used in clojurescript inside js projects? I’ve seen mori, but I’m not sure whather that’s the same as the data structures in cljs
@fifigyuri Mori is in fact ClojureScript
@dnolen, so passing a clojurescript datasctructure to a js code can be understood using mori, and vice-versa..
yes but the caveat is that ClojureScript data structures cannot be used like JS data structure literals
we do support ES6 Map
interface for hash maps and Iterable
protocols for all the collections
@fifigyuri didn't quite understand your question, why not add clojurescript directly to your js project instead of using mori?
bringing ClojureScript into an existing JavaScript application isn’t really all that practical
yeah, was confused cause he said "thinking about the possibility to use clojurescript in some parts"
@lockdownz if I want to introduce a clojurescript code to our codebase, it has to somehow live inside of the already existing application, right now we have backbone models, can be used by clojurescript I know, but that’s not real deal of clojurescript. we use in some subparts of application an immutable data structures and use react. we can choose between immutable.js and mori, using mori gives us later the option to use in parts clojurescript. I’m thinking about a gradual process, using mori with react in some parts can be a way to start
why does compiler gives a warning for (- nil 1)
, but doens’t for (- (first '()) 1)
?
the first one is easy to statically check, the other is not so easy so cljs doesn't attempt to
hm. So this is a compile-time warning, ok. I thought (- nil 1)
is a problem during run-time.
don't really know how clojurescript handles that but I'd assume what I said above would be valid too
as per nil
being implicitely converted to a number, that's probably just what javascript does for numbers
hiya there, first post.
just a quicky q: why I can't (require 'clojure.zip)
in clojurescript?
@vemv I can require it.
here I can http://clojurescript.io/ here I can't http://clojurescript.net/
that's not an official page