Fork me on GitHub
#beginners
<
2017-10-22
>
boldaslove15602:10:44

Hi! Has anyone ever been bitten with No reader function for tag <Tag> when compiling .cljs with boot ?

johnjelinek02:10:07

(.Builder. seleniumWebdriver)

Class constructor Builder cannot be invoked without 'new'
how do I invoke with new for cljs?

johnjelinek02:10:12

I get the same if I do (.. seleniumWebdriver Builder) or (-> seleniumWebdriver (.Builder.))

johnjelinek03:10:51

(new (.-Builder seleniumWebdriver) this works!

lvbarbosa10:10:59

I feel that I should know what GPG is, but I don’t

lvbarbosa10:10:59

got it, that’s why then. Never wrote a library nor pushed it to a public repository

jiyinyiyong10:10:29

where do you publish your library?

jiyinyiyong10:10:53

😥 ....no library?...

lvbarbosa10:10:57

I didn’t, because I don’t have one 😬

lvbarbosa10:10:23

You should get some help soon, there’s a lot of proficient devs here, I’m sure someone went through it before 🙂

jiyinyiyong10:10:30

and I deployed tens of packages on Clojars before... however, I can' even repeat my steps without spending a lot of time to do it.

wpcarro14:10:20

Does anyone know a shorthand way to “thunk” something like false? I’ve tried #(false) hoping to be able to call it like (#(false)), but I’m getting a TypeError

wpcarro14:10:34

I’m hoping (fn [] false) isn’t the only way

eggsyntax14:10:26

Yeah, you can't generally write an anonymous function literal that just returns a value, because it gets treated as an implicit function. I can find a description of the details if you'd like.

ajs19:10:56

@ or #(do false)

wpcarro21:10:21

@ thank you for this

eggsyntax14:10:14

You could use (constantly false) if you don't care that it'll return as many times as it's called.

wpcarro14:10:34

@eggsyntax that’s interesting… haven’t seen that before

wpcarro14:10:18

Sorry, but how does that differ from (fn [] false)?

wpcarro14:10:46

Because of the arguments that it accepts?

eggsyntax14:10:51

Oh, it doesn't at all. Both of them will return indefinitely.

wpcarro14:10:01

Perhaps it’s similar to (fn [& args] false)

eggsyntax14:10:24

The only reason I'd generally use one over the other is aesthetic preference.

wpcarro14:10:46

gotcha… I like the semantics provided by constantly

eggsyntax14:10:16

You might be interested in repeatedly as well.

eggsyntax14:10:27

(not for this case, but it's a similarly interesting one)

wpcarro14:10:07

is using constantly in lieu of (fn [] :thing) idiomatic?

eggsyntax14:10:45

I wouldn't say so; I feel like I see both pretty regularly. I find it slightly prettier, but that's just personal preference.

wpcarro14:10:24

@eggsyntax thanks for the help

eggsyntax14:10:49

NP. This SO question describes a couple of other alternatives, btw: https://stackoverflow.com/questions/13204993/anonymous-function-shorthand

eggsyntax14:10:11

I wouldn't personally use the #(-> %) suggestion, though; it would throw me off for a minute if I bumped into it.

eggsyntax14:10:40

(or in your case #(-> false))

michael.ford16:10:46

Anyone able to help me understand why certain functions like source and dir are not available after I switch the REPL to the namespace of my current project?

eggsyntax16:10:55

@mike you can still access them from the repl namespace, eg (clojure.repl/source)

michael.ford16:10:26

@eggsyntax awesome, thank you!

ashnur18:10:49

i am struggling to use tooling. in general. i have this WARNING: CIDER's version (0.16.0-snapshot) does not match cider-nrepl's version (0.15.0). Things will break! i read the docs, i did what it says. it is still appearing. there are also 4 other things that are broken. this is just how i got the template, i barely changed a line.

ashnur18:10:10

really, where should i start, because this seems to much (chestnut)?

eggsyntax18:10:34

@ashnur Ah, yeah, the cider/nrepl/clj-refactor thing can be a bit challenging at first. Do you already have emacs experience? If not, you might be better off starting with a simpler tool rather than try to learn both Clojure and Emacs at the same time. And I say that as a complete Emacs fanboy.

eggsyntax18:10:49

Are you by chance using luminus?

ashnur18:10:51

i have very little spacemacs experience

ashnur18:10:03

but this is the only setup that at least barely works

ashnur18:10:10

everything else i didn't even got this far

eggsyntax18:10:14

Spacemacs is definitely the best emacs to get started with IMHO -- but it's still a big, complicated beast.

eggsyntax18:10:44

Oh, no, you said chestnut, not luminus, I forgot.

eggsyntax18:10:16

It might be reasonable to ignore that warning for now -- in my experience, it rarely actually causes problems. But it's been a few versions since I've encountered it.

ashnur18:10:30

there is another warning WARNING: clj-refactor and refactor-nrepl are out of sync.

ashnur18:10:48

and there is the problem that the css isn't being written in resources by the sass plugin

eggsyntax18:10:53

I would say that Cursive has the reputation of being the easiest way to get started with Clojure/ClojureScript. It's something you have to pay for, but IIRC you get some months of trial before having to pay for anything.

ashnur18:10:10

i don't have money

ashnur18:10:13

so no cursive

eggsyntax18:10:25

Sure, I'm just suggesting you might want to use it for now, with the free trial.

gonewest81818:10:34

Cider-jack-in should automatically inject the correct version of cider-nrepl. Possible you are overriding that in ~/.lein/profiles.clj? Or are you starting the repl by hand and connecting to it with M-x cider-connect?

eggsyntax18:10:48

Yeah, the out-of-sync stuff pretty much is usually some combination of cider-nrepl/clj-refactor/refactor-nrepl.

ashnur18:10:06

@gonewest818 checking

eggsyntax18:10:08

Also: is your spacemacs fully up-to-date? Or is it a version you installed a while ago?

ashnur18:10:22

yes, updated it today

eggsyntax18:10:33

Cool. Have you updated packages as well?

ashnur18:10:11

@gonewest818 you were right, i had it in profile

eggsyntax18:10:59

You used to have to do that, you may have encountered an outdated guide somewhere.

eggsyntax18:10:09

@gonewest818 good call 😄

ashnur18:10:37

yeah, i don't even know what these things do, i have to check them now one by one if i need them

eggsyntax18:10:50

BTW, CIDER has pretty terrific documentation, including a good troubleshooting section -- that's another place to look if you encounter further difficulties. https://cider.readthedocs.io/en/latest/troubleshooting/

eggsyntax18:10:20

@ashnur have you added the clojure layer to your dotspacemacs-configuration-layers?

ashnur18:10:51

i think spacemacs now asks you if you want to do that and does it for you

ashnur18:10:11

i have it added, checked it

ashnur18:10:50

dunno, i think it's way too big for it to be good

ashnur18:10:11

but i know clojure people have different view of documentation than i have 🙂

eggsyntax18:10:49

Heh. If anything, I'd say that the clj/s community usually tends to run a bit light on documentation. But CIDER certainly has a lot. Don't hesitate to bring up more questions, we're happy to help you get going. There are also friendly & helpful #spacemacs and #cider channels.

ashnur18:10:25

well, if i ignore the warnings, how to debug the css generation thing. i generated the template to use +sass and there is an scss file in src/ but there is no css output

ashnur18:10:47

best thing would be to know how to include bulma though 😄

eggsyntax18:10:55

Ah. There I've got zero clue. Possibly you need a sass or css layer in spacemacs? But I really have no idea.

ashnur18:10:06

has to be some build config

ashnur18:10:17

i will go and search

ashnur18:10:50

it's just strange, when in 2012 i started learning javascript, the experience was already Just Works™

ashnur18:10:37

people laugh at js tooling, but usually it takes months before you start hating grunt gulp and all the other weird stuff 🙂

ashnur18:10:49

until then, it just works out of the box.

ashnur18:10:01

although js doesn't have figwheel either :-<

eggsyntax18:10:58

Clojure/Script tends to favor conceptual simplicity over familiarity & ease of getting started. The big payoffs generally come later, especially on larger projects. That said, folks are definitely doing a lot of great work on getting-started/ease-of-use stuff. But there's certainly some left to be done.

ashnur19:10:17

i am not sure you can go simpler than the npm modules i am using. the tooling is definitely not simple in any way. leiningen is not simple. maybe boot, but boot doesn't have hmr

eggsyntax19:10:35

"Simple" in a particular sense, as described in this talk, which I highly recommend: https://www.infoq.com/presentations/Simple-Made-Easy

ashnur19:10:41

i saw that talk at least 3 times by now

ashnur19:10:53

and i don't think leiningen is simple in that way

ashnur19:10:07

more like easy

eggsyntax19:10:08

Fair enough. I can see how you could make that argument.

ashnur19:10:34

i think where the simplicity is most clear is datomic and datascript

ashnur19:10:51

the things i did with datascript was mindblowing and i used it from javascript

ashnur19:10:06

for weeks every day i found something new in it