Fork me on GitHub
#clojurescript
<
2018-11-13
>
todo10:11:40

is there an easy way to call JS functions from klipse? or is klipse off in it's own isolated space ?

nustiudinastea16:11:38

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

dnolen16:11:38

@nustiudinastea could be bug, if so open a ticket with the minimal steps to reproduce

nustiudinastea17:11:54

@dnolen ok, I will first try re-produce in a different example and if it has the same behaviour I will open a ticket

nustiudinastea17:11:02

I can already say I can't reproduce it in a simple example, could be related to the re-frame/reagent application db

nustiudinastea17:11:31

@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

dnolen18:11:53

@nustiudinastea I’m assuming to find the key you must provide a proper comparison fn

dnolen18:11:05

so I don’t know it could work w/o that

andy.fingerhut21:11:55

@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?

andy.fingerhut21:11:19

If so, that will not lead to happiness.

idiomancy23:11:08

~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~> &gt; ~Now that we have a simple program, let’s build and run some ClojureScript:~ &gt; ~`clj --main cljs.main --compile hello-world.core --repl`~

idiomancy23:11:21

where is cljs.main coming from? should that be on my classpath? when I run that command, I get a java.io.FileNotFoundException: Could not locate cljs/main__init.class or cljs/main.clj on classpath.

idiomancy23:11:49

the clj command works fine and loads a repl

idiomancy23:11:04

I'll move this to #beginners, I suppose