#clojure log - Jan 09 2017

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

1:21 Seylerius: Okay, how do I read an edn file?

1:21 Clojure 1.8

1:33 ridcully_: with clojure.edn/read

1:41 Seylerius: ridcully_: Somehow I can't `require` clojure.edn

1:54 ridcully_: you have to be more specific then. what is the code, what is the error

1:56 Seylerius: Well, I managed to call clojure.edn/read directly, but now it's not reading properly.

1:56 (def checked-data (with-open [edn-file (io/reader "../cleaned.edn")] (clojure.edn/read edn-file)))

1:56 CompilerException java.lang.ClassCastException: java.io.BufferedReader cannot be cast to java.io.PushbackReader, compiling:(form-init3778823564624194270.clj:65:63)

2:03 ridcully_: add (java.io.PushBackReader. (io/reader ...))

2:07 Seylerius: ridcully_: That did it, thanks.

5:18 osfabibisi: eeek, they've announced my talk! http://www.lambdalounge.org.uk/#text-editor-data-structures

5:18 (now I have to go and write it...)

5:19 mengu: when i'm in lein repl, is there an easy way to install a dependency? for example, i'm in repl and i wanted to try out clojure.core/match. how should i proceed? close the repl, download the jar, add it to my classpath, re-start the repl?

5:20 dysfun: that's what i used to do

5:21 pomegranate exists though

5:21 osfabibisi: oh, lein doesn't have the boot thing of just adding it to your dependencies?

5:21 (even then you still have to close the repl and reopen it to download and install it)

5:21 wink: osfabibisi: that sounds really interesting, would love to watch that

5:21 dysfun: lein doesn't have "just do the deps"

5:21 osfabibisi: no you don't, you just eval the set-env! in the rrepl

5:22 https://github.com/cemerick/pomegranate is the way forwards with lein

5:23 wink: dysfun: what do you mean with 'just do the deps' - as in, interactively?

5:23 dysfun: wink: lein has this 'everything is config' approach, which means there isn't just a function 'install-deps'

5:23 boot's set-env functions for doing that

5:24 wink: dysfun: did you look at the implementation of 'lein deps'?

5:24 dysfun: no, but i don't see how i'd be able to run that in a repl and have the state updated, so it's a boot moot?

5:25 hence my recommendation of pomegranate. which lein uses under the hood

5:26 wink: sure, but I'm just wondering if it wouldn't be possible anyway

5:26 dysfun: ok, well basically boot exposes all the things you need as functions because there is no 'config api'

5:26 osfabibisi: dysfun: ah, I had no idea

5:26 wink: well I've never used boot, so that point is moot for me :P

5:27 dysfun: well, sure, until you consider that means that the way you install deps in a repl is the same way you install deps in a build.boot

5:28 so you can just keep updating your build.boot in emacs and keep evaling the changed bit of your build.boot as you modify it

5:28 that btw, is my favourite boot feature, hands down

5:28 mavbozo: wink, i've used vinyasa so that i can pull dependencies in the repl

5:28 like (pull '[my.lib])

5:29 dysfun: now, `lein deps` in another shell will make sure the dep is installed, but it won't update your classpath

5:29 not for the running repl

5:29 mavbozo: hmm, vinyasa now known as lucidity

5:29 wink: dysfun: yeah, I know that much. but that doesn't mean it can't be fixed

5:29 mavbozo: wink, is this what you want http://docs.caudate.me/lucidity/lucid-package.html#pull

5:30 dysfun: i don't know what a 'fix' would look like. probably default exporting a new function in the lein api into the repl namespace

5:30 wink: mavbozo: that sounds useful, yes, but still the problem with the claspath persists I guess

5:36 dysfun: there will always be problems with the classpath :)

5:37 wink: mavbozo: hm, doesn't work for me but I'll try in a different project

6:03 mengu: thanks dysfun

6:03 i'll check out pomegranate

Logging service provided by n01se.net