Fork me on GitHub
#clojure
<
2016-09-23
>
lxsameer02:09:33

what do you guy use as flycheck backend with emacs ?

dadair03:09:21

I’ve found I don’t really need flycheck so much in a REPL-oriented development workflow

dadair03:09:49

I also run sexps in cider often while building up a function, and if that fails, cider will point out what I did wrong

eggsyntax13:09:22

I'm a bit confused by something. The documentation for CLJ-1993, included in 1.9-alpha12, says "Add new print flag *print-namespace-maps* to optionally suppress namespace map syntax. Default flag to false. Set flag to true as part of the standard REPL bindings. This allows repl users to (set! *print-namespace-maps* false) if desired." But that doesn't seem to work for me:

db.seed.create-specs> (set! *print-namespace-maps* false)
false
db.seed.create-specs> (println *print-namespace-maps*)
true
Can anyone tell me why?

eggsyntax14:09:34

I should note that (binding [*print-namespace-maps* false] (println {:foo/bar 1 :foo/baz 2 :foo/bap 3})) and (do (set! *print-namespace-maps* false) (println {:foo/bar 1 :foo/baz 2 :foo/bap 3})) work as expected. But it'd be really nice to be able to turn it off at the REPL, and I thought alpha12 specifically added that.

Alex Miller (Clojure team)15:09:18

I can’t reproduce your code snippet above

Alex Miller (Clojure team)15:09:29

user=> *print-namespace-maps*
true
user=> {:a/b 1}
#:a{:b 1}
user=> (set! *print-namespace-maps* false)
false
user=> *print-namespace-maps*
false
user=> {:a/b 1}
{:a/b 1}

Alex Miller (Clojure team)15:09:50

that said, I’m in a base Clojure repl here, not lein/boot/or other REPL

Alex Miller (Clojure team)15:09:54

and this is dependent on what env the REPL you’re using sets - it’s entirely possible a different repl would not be setting *print-namespace-maps* in the environment around evaluation like the Clojure repl (now) does

Alex Miller (Clojure team)15:09:13

that’s not something we can fix from Clojure though

Alex Miller (Clojure team)15:09:10

the only reason set! works here is that the REPL is binding *print-namespace-maps* around your eval

eggsyntax15:09:03

Thanks, Alex, that totally clarifies it.

borkdude15:09:04

Why does (vals {}) not return a sequence?

exupero15:09:23

It when-lets on (seq hash-map).

borkdude15:09:17

I guess so yes

mbertheau15:09:20

I want to map every element of a vector except the first. What's a concise way to do that? I.e. (mapv f my-vec) but leave the first element unchanged.

borkdude15:09:06

I guess it yields a special case when serializing to json

borkdude15:09:16

because here nil can mean several things now

mbertheau15:09:29

(vec (concat [(get v 0)] (mapv f (subvec v 1)))) is a bit unwieldy.

jr15:09:43

(into [(first v)] (map f (rest v)))

mbertheau15:09:49

nice! Thanks!

benjyz20:09:12

hello. anyone an idea how I can define a console logger in timbre? trying with this

candiedcode21:09:23

@benjy timbre has a console appender

candiedcode21:09:33

:println {:enabled? true}

hlolli23:09:38

How could I get true here

(def xxx (fn []))
(def yyy (fn []))
(= xxx yyy)
via quoting?

bfabry23:09:48

@hlolli depends what question you want to ask with your =. (= (fn []) (fn [])) is not true, but (= '(fn []) '(fn [])) is certainly true

hlolli23:09:06

I want the truth and nothing but the truth 😛 (so the latter one), there is to say, some combo of '~ but Im not sure which I need here to resolve the symbol and then quote.

bfabry23:09:30

ok, so if it's been bound to a symbol then it's not true, basically. a function is a class that's been generated. two functions are not the same thing even if they were generated from the same code. afaik, the code isn't kept anywhere, so there's probably no way to establish that they were created from the same code

hlolli23:09:55

hmm good point, I guess this would then only be possible with a macro, but in my case macro would be stupid. Thanks for this input @bfabry

crocket23:09:54

Does anyone use LightTable? Is it as ok as Emacs?

bfabry23:09:43

I used to use LT. I kinda consider it abandoned now and it had a lot of problems when I left. I used Emacs for a while but couldn't deal with the yak shaving every time I updated plugins. I use Cursive now which I like a lot

vinnyataide23:09:29

@bfabry what is yak shaving?

vinnyataide23:09:38

I use emacs and don't know what's this

bfabry23:09:38

yak shaving is a term for non-core work. ie every time I updated emacs plugins something would stop working and I'd waste some time fixing it

hlolli23:09:43

LightTable is what I install for all people I teach Clojure to. But this is so controversial topic that everyone has their own opinion. Ask me then young cyberpunks go with Emacs, and corporate/enterprise kind of type go with Cursive(IntelliJ). But you find much exception to my generalization.

jcsims23:09:30

@sbauer is actually in the process of freshening up Light Table. It's been getting more love recently

bfabry23:09:34

haha jesus after something like 15 years of using only vim as an editor I never expected to be called a corporate/enterprise type 😛

hlolli23:09:04

Maybe you never expected to get older 🙂

crocket23:09:29

Is lighttable abandoned? It still sees commits.

bfabry23:09:10

I'm probably wrong about LT, that was the impression I got well over a year ago. that's a long time

hlolli23:09:33

Lighttable is fine and works great. And sounds like its being kept up. So go for LightTable 🙂

crocket23:09:08

I'm using emacs at this moment.

crocket23:09:31

I tried LightTable now, and it seems to lack a lot of things that come with emacs.

hlolli23:09:05

If you already know emacs then LightTable brings little new.

bfabry23:09:25

interestingly the only public git repo I've ever started that got some forks is a light table plugin 😆