reload file in lein

1,443 views
Skip to first unread message

Jay Vyas

unread,
Aug 14, 2011, 8:20:14 PM8/14/11
to clo...@googlegroups.com
hi guys, Im doing the following development "workflow"

-> edit a script in vi
-> save
-> $> lein repl
->     repl>(load-file src/foo/core.clj)
        repl>(use `foo/core)

I wanted to edit the file and reload it without reloading repl.  is that possible. ?

--
Jay Vyas
MMSB/UCHC

Dave Ray

unread,
Aug 14, 2011, 8:25:09 PM8/14/11
to clo...@googlegroups.com
This works for me:

repl> (use 'foo.core :reload)

or :reload-all if deps of the foo.core ns have changed. Also,
(load-file) shouldn't be necessary.

Cheers,

Dave

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

AtKaaZ

unread,
Jan 28, 2013, 11:15:29 AM1/28/13
to clo...@googlegroups.com
maybe he needs to :reload-all for each use in foo.care? ie.
(ns foo.core
  (:use [runtime.q :as q] :reload-all)
  (:use [datomic.api :only (q db) :as d])
  (:use [runtime.util :as u] :reload-all)
)
so that it will also reload whatever foo.core is using, in this example it's only going to reload runtime.q and runtime.util namespaces when foo.core is (re)loaded (since changing datomic version in project.clj would require repl restart), and assuming those namespaces are part of the project like foo.core is.

oh wait, did I just read the date right? On Monday, 15 August 2011 01:20:14 UTC+1, Jay Vyas wrote:
(I didn't have his previous msg in my email)


On Mon, Jan 28, 2013 at 4:10 PM, Chris F Carroll <chrisf...@gmail.com> wrote:
Does just loading the file again not work:
repl>(load-file src/foo/core.clj)
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group, send email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
I may be wrong or incomplete.
Please express any corrections / additions,
they are encouraged and appreciated.
At least one entity is bound to be transformed if you do ;)
Reply all
Reply to author
Forward
0 new messages