Fork me on GitHub
#boot
<
2016-08-20
>
mitranim16:08:30

Hi everyone, sorry if that's a dumb question, but how do I reload/reactivate build.boot while in the boot repl?

mitranim16:08:57

When changing dependencies, adding tasks, etc

mitranim16:08:54

(eval (read-string-all (slurp "build.boot"))) kinda seems to work, but also reports a null pointer exception (asyncronous?); wonder if there's a better way

micha16:08:20

@mitranim you can do (load-file "build.boot") in the repl

micha16:08:38

that's clojure.core/load-file

micha16:08:54

there is also clojure.core/load-string btw

mitranim16:08:09

@micha Works, and without exceptions, nice. Thanks!

micha16:08:15

eval won't do the right thing exactly

mitranim16:08:25

why a difference?

mitranim16:08:59

I mean load-string literally says "read and evaluate"

alandipert16:08:14

Load string handles multiple top level forms

mitranim16:08:49

huh now I see the error, was feeding it a list of top-level forms

mitranim16:08:26

it evaled them all, then tried to call the result of (set-env! ...) as a function...

micha16:08:47

load is different from eval, i'm pretty sure

mitranim16:08:11

(doseq [form (read-string-all (slurp "build.boot"))] (eval form)) seems to produce a similar result

mitranim16:08:20

(doesn't return the result of the last form though)

micha16:08:57

if your file is a namespace eval totally won't do it

micha16:08:18

like evaling forms to create a new namespace etc

micha16:08:25

the build.boot case isn't a namespace, so evaling could work

micha16:08:48

interesting, that looks like it's just reading and evaling

micha16:08:54

now i am confused

flyboarder16:08:58

@micha isn't load-file also classpath aware, so it can resolve the namespace stuff