2017-01-09
| 01:21 | Seylerius | Okay, how do I read an edn file? |
| 01:21 | Seylerius | Clojure 1.8 |
| 01:33 | ridcully_ | with clojure.edn/read |
| 01:41 | Seylerius | ridcully_: Somehow I can't `require` clojure.edn |
| 01:54 | ridcully_ | you have to be more specific then. what is the code, what is the error |
| 01:56 | Seylerius | Well, I managed to call clojure.edn/read directly, but now it's not reading properly. |
| 01:56 | Seylerius | (def checked-data (with-open [edn-file (io/reader "../cleaned.edn")] (clojure.edn/read edn-file))) |
| 01:56 | Seylerius | CompilerException java.lang.ClassCastException: java.io.BufferedReader cannot be cast to java.io.PushbackReader, compiling:(form-init3778823564624194270.clj:65:63) |
| 02:03 | ridcully_ | add (java.io.PushBackReader. (io/reader ...)) |
| 02:07 | Seylerius | ridcully_: That did it, thanks. |
| 05:18 | osfabibisi | eeek, they've announced my talk! http://www.lambdalounge.org.uk/#text-editor-data-structures |
| 05:18 | osfabibisi | (now I have to go and write it...) |
| 05: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? |
| 05:20 | dysfun | that's what i used to do |
| 05:21 | dysfun | pomegranate exists though |
| 05:21 | osfabibisi | oh, lein doesn't have the boot thing of just adding it to your dependencies? |
| 05:21 | osfabibisi | (even then you still have to close the repl and reopen it to download and install it) |
| 05:21 | wink | osfabibisi: that sounds really interesting, would love to watch that |
| 05:21 | dysfun | lein doesn't have "just do the deps" |
| 05:21 | dysfun | osfabibisi: no you don't, you just eval the set-env! in the rrepl |
| 05:22 | dysfun | https://github.com/cemerick/pomegranate is the way forwards with lein |
| 05:23 | wink | dysfun: what do you mean with 'just do the deps' - as in, interactively? |
| 05:23 | dysfun | wink: lein has this 'everything is config' approach, which means there isn't just a function 'install-deps' |
| 05:23 | dysfun | boot's set-env functions for doing that |
| 05:24 | wink | dysfun: did you look at the implementation of 'lein deps'? |
| 05: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? |
| 05:25 | dysfun | hence my recommendation of pomegranate. which lein uses under the hood |
| 05:26 | wink | sure, but I'm just wondering if it wouldn't be possible anyway |
| 05:26 | dysfun | ok, well basically boot exposes all the things you need as functions because there is no 'config api' |
| 05:26 | osfabibisi | dysfun: ah, I had no idea |
| 05:26 | wink | well I've never used boot, so that point is moot for me :P |
| 05: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 |
| 05:28 | dysfun | 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 |
| 05:28 | dysfun | that btw, is my favourite boot feature, hands down |
| 05:28 | mavbozo | wink, i've used vinyasa so that i can pull dependencies in the repl |
| 05:28 | mavbozo | like (pull '[my.lib]) |
| 05:29 | dysfun | now, `lein deps` in another shell will make sure the dep is installed, but it won't update your classpath |
| 05:29 | dysfun | not for the running repl |
| 05:29 | mavbozo | hmm, vinyasa now known as lucidity |
| 05:29 | wink | dysfun: yeah, I know that much. but that doesn't mean it can't be fixed |
| 05:29 | mavbozo | wink, is this what you want http://docs.caudate.me/lucidity/lucid-package.html#pull |
| 05: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 |
| 05:30 | wink | mavbozo: that sounds useful, yes, but still the problem with the claspath persists I guess |
| 05:36 | dysfun | there will always be problems with the classpath :) |
| 05:37 | wink | mavbozo: hm, doesn't work for me but I'll try in a different project |
| 06:03 | mengu | thanks dysfun |
| 06:03 | mengu | i'll check out pomegranate |