Fork me on GitHub
#clojurescript
<
2016-05-27
>
dnolen00:05:53

I’m planning on working on it tomorrow

dnolen00:05:40

I’d say give it a couple of weeks and expect changes - clojure.spec is still evolving

bpicolo01:05:30

"ANALYSIS ERROR: Unmatched delimiter ) on file null, line null, column null" welp lein, not sure what you want from me

danielbraun01:05:19

syntax error - you have an unbalanced parenthesis. you should use something like paredit http://danmidwood.com/content/2014/11/21/animated-paredit.html

bpicolo01:05:23

aha, updating clojure seems to have helped

bpicolo01:05:36

dabra it's more the null file, column that's blockin me, hah

bpicolo01:05:03

that said, I shouuuld learn paredit at some point

bpicolo01:05:43

is there a good clojurescript linter anywhere? Maybe auto formatter?

danielbraun01:05:49

once you’ve learned you’ll curse yourself for not learning it earlier

bpicolo01:05:35

clojurescript is my first foray into lisps

danielbraun01:05:17

there’s no syntax in lisp (or it’s very minimal) so linters are not popular. there’s no syntax to check

danielbraun01:05:43

generally you just evaluate forms inside your editor

bpicolo01:05:46

Linters these days usually give use best-practicey sorts of stuff which I like a lot

danielbraun01:05:39

it’s nice to have, unlike javascript where jslint is a must

bpicolo01:05:52

dabra: that looks great!

bpicolo01:05:08

I consider linters a must in general. Lightweight, make me worry less, automatically happens on save

bpicolo01:05:11

what's not to love? 😄

danielbraun01:05:31

yeah except in clojure saving you evaluate much more often than save

danielbraun01:05:51

but try it out… good luck

bpicolo01:05:52

What do you mean?

danielbraun01:05:10

in clojure you build your program interactively within your editor

danielbraun01:05:43

or in the repl

bpicolo01:05:51

Could you describe further for me the former?

danielbraun01:05:55

anyway eastwood works for clojure, not for clojurescript

danielbraun01:05:43

sec i’ll send you a link

bpicolo01:05:33

I am using lein with figwheel so I dooo expect things to refresh in realtime

bpicolo01:05:39

if that's..sort of what you're mentioning

leontalbot02:05:48

Hello! I want to use cljsjs/selectize but not like this (.selectize (js/jQuery (.getElementById js/document "#dropdown")))

leontalbot02:05:21

Instead I want to create a fn that can generate a select, without bothering about any id

leontalbot02:05:35

How could I do that?

leontalbot02:05:39

Thanks in advance!

bpicolo02:05:14

@leontalbot: make a function that wraps it?

leontalbot02:05:17

Yes, something like (defn select [selectize-args body] ...)

bpicolo02:05:43

how do you expect to call it?

nothingdhsp05:05:27

@dabra : Hello I am very new to clojurescript. I have used clojure for a year , but not clojure script. Do you know if I can use vim to connect to figwheel.

pesterhazy09:05:58

Oh my god, I have javascript fatigue, and I'm not even using javascript.

jcromartie13:05:50

where are things like "#js" and "js*" documented?

jcromartie13:05:02

and they are hard to Google 🙂

exupero13:05:18

@nothingdhsp: You can connect to Figwheel with vim-fireplace. I had to apply a pending pull request to vim-fireplace to support configuring the repl environment.

jcromartie13:05:07

thanks those are great

jcromartie13:05:17

I found the cheat sheet but it didn't mention js*

jcromartie13:05:27

and neither does the syntax ref

jcromartie13:05:42

I wonder if it's safe to use

jcromartie13:05:44

if it's undocumented

jcromartie13:05:47

will it go away in the future?

pesterhazy13:05:36

what does it do? It's new to me.

dnolen13:05:53

@jcromartie: js* is not safe to use, implementation detail

underplank17:05:26

Is there anyway at the moment to make a synchronous http request in clojurescript? I need to make some http-requests before each of my tests run, and I need them to be synchronous, or at least complete before the other tests start.

underplank17:05:12

At the moment Im trying to do it in the :before of the use-fixtures function.

wilkerlucio17:05:13

@underplank: had you tried to use async tests? if you use cljs.test (the native one) it has this support: https://github.com/clojure/clojurescript/wiki/Testing#async-testing

underplank17:05:36

I wasnt sure If I could do this in the :before block?

underplank17:05:00

of use-fixtures? I guess its just a function/macro.

wilkerlucio17:05:17

check the Async Fixtures on that same page, just after async tests 😉

dviramontes17:05:08

Hello all, trying to translate this but having a hard time from JS -> CLJS

var xScale = new Plottable.Scales.Linear();
any clues ? I have tried so far:
(def x-scale (.Linear (.-Scales (new js/Pottable))))
but no luck :< any ideas ???

anmonteiro17:05:07

@dviramontes: (def xScale (js/Plottable.Scales.Linear.))

anmonteiro17:05:20

note the . at the end

pesterhazy17:05:09

@dviramontes: I think your original is correct

anmonteiro17:05:37

it’s not, he wants to instantiate Linear and is instantiating Plottable

pesterhazy17:05:43

ah maybe "new" doesn't bind as tightly as I though it does in js

pesterhazy17:05:56

damn you, non-lisp!

pesterhazy17:05:01

new String.length (error) vs (new String).length

dviramontes17:05:14

@anmonteiro: that worked! thanks ^^

mudphone18:05:04

Hi, anyone know if there’s some docs on using ES6 from ClojureScript? I’m looking at the foreign-libs portion of https://www.niwi.nz/cljs-workshop/, but still have some questions.

mudphone18:05:45

The reason is that I’d like to use the Phoenix Framework’s channel client (written in ES6 js) from CLJS.

risto18:05:23

are you trying to use an es6 module?

risto18:05:51

you can bundle that into a standalone and then create an extern of it

mudphone18:05:25

thanks, when you say bundle into a standalone, do you mean compile to its own js file?

risto18:05:00

i mean using browserify to bundle into a umd module so you can use it like a regular js file

risto18:05:25

via --standalone

mudphone18:05:49

ah, okay, thanks

pat22:05:50

Poll: would you rather have async functions prefixed with "a-" or "a" ? 👍 for "a-", 👎 for just "a"

tdaudelin22:05:54

Hmm, personally I wouldn't want an indicator in the function name. I prefer function names to explain "what" not "how"

pat22:05:01

These are io functions, the how is relevant

tdaudelin22:05:53

Well, given the two choices I guess I'd go with "a-"

zentrope23:05:50

I’ve got a single page, reacty app (etc) and want to provide a button allowing folks to download a CSV file of data I have locally (not on the server). Any tips?