Fork me on GitHub
#beginners
<
2016-08-11
>
porglezomp00:08:52

(first dependents) is outside the let, it looks like.

porglezomp00:08:06

There’s a ]), when it should only be a ]

porglezomp00:08:35

Which means it’s trying to apply the function to some other variable that’s not seqable, instead of the seqable thing you created in the scope of the let.

senya2200:08:11

spot on - thanks @porglezomp !

mariogintili14:08:45

Hello guys! I have a small question, getting the following error:

Exception in thread "main" java.io.FileNotFoundException: Could not locate chat_analysis_clj/read_data__init.class or chat_analysis_clj/read_data.clj on classpath: , compiling:(chat_analysis_clj/core.clj:1:1)
	at clojure.lang.Compiler.load(Compiler.java:7142)

[....]

Caused by: java.io.FileNotFoundException: Could not locate chat_analysis_clj/read_data__init.class or chat_analysis_clj/read_data.clj on classpath: 
My app code stands src/read-data
(ns chat-analysis-clj.read-data
 (:require [ :as io]
           [incanter.core :as i]
           [incanter.excel :as xls]))

(defn load-data []
  (-> (io/resource "./data/transcript.xlsx")
      (str)
      (xls/read-xls)))
and my core.clj
(ns chat-analysis-clj.core
  (:require [incanter.core :as i]
            [ :as io]
            [incanter.excel :as xls]
            [chat-analysis-clj.read-data  :refer :all]))

(defn -main [& args]
  (println (load-data)))

chris14:08:34

the file read-data.clj should be read_data.clj

mariogintili14:08:26

@chris thanks, why is that?

chris14:08:07

the ns form relates a ns with a hyphen to a file with an underscore

chris14:08:40

according to stackoverflow it’s a workaround for java interop

chris14:08:56

hyphens aren’t valid in class names

polymeris19:08:53

Hi. How do I deal with JS promises from clojurescript?

polymeris19:08:21

In particular, can I convert them to cljs promises?

polymeris19:08:12

...or deref them, then I could wrap them in a cljs promise

polymeris19:08:36

i could use core.async... but seems like a lot of work

chris19:08:51

I mean you can just deref them with js interop

polymeris19:08:57

oh... you need a library for promises in cljs?

polymeris19:08:22

can js promises be deref 'd, @chris?

polymeris19:08:33

I haven't found out how

chris19:08:36

(.then promise function)

polymeris19:08:31

☝️ returns the promise, not the argument passed to function

porglezomp19:08:09

How should I organize my tests if I want to do unit testing with Figwheel?

porglezomp19:08:38

There’s the :cljsbuild that Figwheel uses, should I add a test folder to the :source-paths

porglezomp19:08:58

Or put a test namespace in my project namespace?

shaun-mahood19:08:25

@porglezomp: The links on this issue seem like they might help, there's a couple examples that look pretty relevant - https://github.com/bhauman/lein-figwheel/issues/162 Have you looked into the testing capabilities of devcards? It is certainly much more than just for tests, but I absolutely love it and do all my front end unit testing there now. https://github.com/bhauman/devcards

porglezomp19:08:51

I’ve looked at devcards a little bit, I hadn’t though of that for this though. I’m writing extremely unit-y code right now, doing stuff like rectangle intersections, so plain tests were my first thought.

porglezomp19:08:08

Also, just curious, can you split devcards onto multiple pages? I’ll be testing a WebGL application once I start testing stuff visually, so I would only be able to have 16 things loaded on one page.

porglezomp20:08:15

I just started watching the demo video, so I suppose I answered my own question.

shaun-mahood20:08:25

@porglezomp: If you're interested in devcards at all it would probably be worth posting what you want to try on the #C09GR9UJC channel - I've never used it for anything like that so I can't really help. It sounds cool though! The example at http://rigsomelight.com/devcards/#!/devdemos.two_zero has a lot of non-visual tests and might also give you an idea of what it's like to combine testing cards and other cards.

porglezomp20:08:26

I’ll just need to split the devcards into multiple files.