Fork me on GitHub
#clojure
<
2017-12-31
>
joshkh00:12:21

As a newcomer to Emacs, am I better off with a vanilla installation + recommended packages (CIDER etc), or Spacemacs in evil mode with the Clojure layer? Is learning Emacs for the first time in evil mode doing myself a disservice?

joshkh00:12:03

For what it's worth I'm coming from Cursive.

arrdem00:12:49

Depends on whether you're already used to modal editing / vim mode elsewhere. I personally run emacs with CIDER and my own custom config without evil or any of the total conversion suites but I also know a bunch of people that love them.

arrdem00:12:16

Spacemacs and doom-emacs are both awesome, although spacemacs is probably the best supported of them all.

arrdem00:12:29

Also depends on how much time you want to spend wrangling vs learning your environment.

rymndhng00:12:23

i'd suggest go for spacemacs -- the out of box experience is a little better. I don't use EVIL (the vim layer) and i have a pretty good experience with spacemacs

joshkh00:12:38

Thanks for the input. I started in evil mode and immediately found myself googling for commands, but the resulting Vim keybindings didn't seem to line up with how Spacemacs works (even with taking into account SPC).

joshkh00:12:38

For instance, to save a buffer, how does SPC f s map to vim?

gonewest81800:12:45

In vi wouldn’t it be : w ?

joshkh00:12:30

Yeah, that was my confusion. Is Spacemacs providing its own shortcuts or something?

noisesmith00:12:11

yes, space introduces nested prefixes

joshkh00:12:14

(I realise these are dumb questions but will ultimately help me understand which mode to invest in)

noisesmith00:12:33

so that every command is a series of single keypresses until you hit a leaf of the tree of shortcuts

noisesmith00:12:10

you can do something similar with vim via leader keys, the difference is that with spacemacs it's not juxt space + some-key, it's space, some-key, another,.... final

joshkh00:12:36

Ahhh, okay, thanks!

noisesmith00:12:12

fwiw I ended up deciding after decades of usage emacs is too fiddly and I was spending too much time messing with elisp and I just switched to vim

noisesmith00:12:01

I'm not much for integrating smart functionality into my editor though, I find it becomes difficult to know what's really happening if something breaks when there's so many tool layers

joshkh00:12:14

I totally get that. Atom + protorepl is another option I've considered for lightweight development. Cursive is fantastic but IntelliJ is heavy handed.

bwstearns00:12:54

So I'm sure I'm just overlooking something here, but is there a common function equivalent to the threading macro which will feed the result of function n to n+1 in a list collection?

seancorfield00:12:12

I switched from Emacs/CIDER to Atom/ProtoREPL a year ago and have been very happy. I was an Emacs user about twenty years ago before I went off to the land of IDEs @joshkh

seancorfield00:12:51

@bwstearns (apply comp [f1 f2 f3 f4]) ?

bwstearns00:12:35

I was thinking about using comp, I think it works but I was wondering if there was something more threading-macro-ish for familiarity's sakes. I think I may actually have just asked for too much ergonomics from clojure

bwstearns00:12:51

thanks for the pointer, I'll give that way an implementation and see how it goes

kenrestivo00:12:15

write a macro?

bwstearns00:12:12

I'm also dynamically building the chains of functions so it'll be (apply comp (reverse func-path)) which I guess isn't too bad.

seancorfield00:12:55

Couldn't you just build the chains in the reverse order in the first place?

bwstearns00:12:00

I want it to be able to be used at run time. I already wrote a macro that was a pain in the ass and I don't think this one will get much performance gain for the maintainability.

bwstearns00:12:14

The chains are made by shortest path calls on loom graphs. I guess I could just switch the start and finish but that'd just move the reverse call from one place to another.

bwstearns00:12:28

It's not really a big issue, just that I'm worried I'm overlooking some issue with regards to the behavioral differences between ->> and comp

bwstearns00:12:45

It's a hobby library so I'd prefer to waste the time and solve the generic case if possible.

bwstearns01:12:17

I think the comp idea works. Is there an agreed upon way to write a marco way and a function way of doing things for varied kinds of desired efficiencies?

johnjelinek03:12:21

what's the equivalent of [org.omcljs/om "1.0.0-beta1" :exclusions [cljsjs/react cljsjs/react-dom]] for deps.edn?

johnjelinek04:12:48

does anyone else find deps.edn/`clj tools` a breath of fresh air? lein + boot have both been madness to me the past two days

johnjelinek04:12:13

thank you to everyone who worked on the clj (CLI) tools

tbaldridge04:12:49

no, you're not the only one 🙂

tbaldridge04:12:08

and IIRC, :exclusions are something that hasn't yet been added to deps code

tbaldridge04:12:31

and it's about to get better, the git stuff being worked on in master will make it even better. I never really liked using maven artifacts anyways.

qqq04:12:49

can tools.reader get me line number and column number for expresiosns / symbols / strings / numbers ?

johnjelinek05:12:46

@tbaldridge: what kind of stuff is coming down the pipe in master?

tbaldridge05:12:33

you can use git repos as deps. So git url + sha (or something of that nature) in place of maven artifacts

johnjelinek05:12:00

cool, I think I'll be able to ditch package.json after that

andy.fingerhut05:12:48

tools.reader can get you line number and column number as metadata attached to data values that can have metadata in Clojure, i.e. collections and symbols, but not keywords, strings, numbers, ...

qqq05:12:42

what, if anything, does tools.reader offer over plain read then ?

qqq07:12:12

ah, Moreover, by using reader types from clojure.tools.reader.reader-types, if using an IndexingReader, column info is available and both line and column metadata is attached not only to lists, but to symbols, vectors and maps too, when additional debugging info is needed (note that the edn reader doesn't add any line/column metadata at all) among other things

alexisvincent11:12:47

Does anyone have tips for making Spacemacs more powerful for Clojure editing. I’m especially looking for things similar to what I had in cursive. Like being able to comment a few lines and have Parens move etc. Also better autocomplete for bindings etc. Essentially stuff to make it a smoother more IDE like experience?

dominicm11:12:50

@alexisvincent I believe you were using parinfer, and there is a parinfer plugin for emacs.

alexisvincent11:12:57

Any idea how this plays with the clojure layer?

alexisvincent11:12:45

Theres a par infer layer 😄

ErhardtMundt18:12:45

I'm working on a re-frame project and I would like to deploy it

ErhardtMundt18:12:48

I tried to execute lein clean and lein uberjar, I get 2 jar files in /target, I try to execute project_name.jar and it nicely boots a jetty server

ErhardtMundt18:12:59

the problem is that no page is served

ErhardtMundt18:12:10

am I doing anything wrong?

noisesmith19:12:47

@erhardt.mundt when using your project, how do you start the server?

noisesmith19:12:03

is the dev command something that re-frame defines?

noisesmith19:12:30

OK - looking at the re-frame template myself, it appears dev uses figwheel to serve your page

noisesmith19:12:04

do you have a ring handler defined for your back-end?

devn19:12:59

@erhardtmundt you said you tried project_name.jar, have you tried the other jar generated by uberjar?

noisesmith19:12:22

the one that isn't an uberjar would just die

erhardtmundt19:12:07

I have, but then I saw some error about missing clojure runtime

erhardtmundt19:12:42

something like that

noisesmith19:12:05

when you say "no page is served" do you mean 404, blank page, ?

noisesmith19:12:34

any errors in the console?

noisesmith19:12:40

(the js console, that is)

erhardtmundt19:12:14

whoops, it looks like it’s down

noisesmith19:12:14

@erhardt.mundt do you have ^:export on your main function that gets called from the script tag?

noisesmith19:12:58

there's a good chance you have something in your cljs that broke with advanced compilation

noisesmith19:12:14

but there would be js console errors to confirm that if so

erhardtmundt20:12:09

thanks @noisesmith, I’ll check it out

jkj20:12:22

clojure-1.9.0.jar does not seem to work by itself without spec, but http://clojure.org releases page only mentions: Requirements: Java 1.6+ (recommended: Java 1.8+)

jkj20:12:35

should it?

jkj21:12:49

lein and boot work nicely. just thought I spotted an issue there.

jkj21:12:05

this page mentions “Requirements”: https://clojure.org/community/downloads

jkj21:12:15

I was just doing some framebuffer and touchscreen stuff on an arm board without any external dependencies and noticed that 1.9 wouldn’t work anymore though the release page only mentions that it needs java. Probably just missing the mention of spec dependency from the webpage.