This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-13
Channels
- # aleph (2)
- # announcements (1)
- # beginners (133)
- # cider (29)
- # cljdoc (9)
- # cljs-dev (2)
- # cljsjs (3)
- # cljsrn (1)
- # clojure (146)
- # clojure-dev (26)
- # clojure-europe (3)
- # clojure-italy (26)
- # clojure-japan (6)
- # clojure-nl (76)
- # clojure-spec (4)
- # clojure-uk (42)
- # clojurescript (17)
- # cursive (43)
- # datascript (1)
- # datomic (28)
- # emacs (4)
- # figwheel-main (13)
- # fulcro (26)
- # hyperfiddle (2)
- # jobs (9)
- # jobs-discuss (6)
- # leiningen (1)
- # mount (5)
- # onyx (8)
- # pathom (5)
- # pedestal (2)
- # re-frame (52)
- # reagent (21)
- # reitit (58)
- # ring-swagger (24)
- # shadow-cljs (95)
- # sql (14)
- # test-check (10)
- # yada (18)
is there an easy way to call JS functions from klipse? or is klipse off in it's own isolated space ?
js/window
hi all, should select-keys work over a sorted-map-by? I am confused about the behaviour of some code I am trying. I have a sorted-map-by and when I do a (select-keys tasks [:bflf2hs5qrtrefivkbj0])
nothing is returned, although the sorted map has that key with a coresponding value
@nustiudinastea could be bug, if so open a ticket with the minimal steps to reproduce
@dnolen ok, I will first try re-produce in a different example and if it has the same behaviour I will open a ticket
I can already say I can't reproduce it in a simple example, could be related to the re-frame/reagent application db
@dnolen I now understand what happened. My sorted-map-by was constructed using a custom comparison function, which only returned -1 and 1, and never 0. Once I added the equality case which returns 0, the resulting sorted map started to behave normally. I still find it a bit confusing because the comparison function doesn't use the key in the map, but a sub-field of the value, so I don't understand why a select-keys does not work. Since the map keys are different than the sub-field I use to perform the sorting comparison
@nustiudinastea I’m assuming to find the key you must provide a proper comparison fn
@nustiudinastea Are you using a comparison function that uses only part of a value for comparing two things, and then you try adding keys that are not =
but your comparison function treats them as equal, because they differ in parts of the value that are ignored by your comparison function?
If so, that will not lead to happiness.
The Clojure guide on comparators has some examples of this: https://clojure.org/guides/comparators#_comparators_for_sorted_sets_and_maps_are_easy_to_get_wrong
~so, I'm timidly trying to move from lein to the new `clj` cli tools, and I'm going through this page... there are some things I dont understand:~ ~<https://clojurescript.org/guides/quick-start~> > ~Now that we have a simple program, let’s build and run some ClojureScript:~ > ~`clj --main cljs.main --compile hello-world.core --repl`~