make the app work with 'lein run' and it'll work in the repl as well.

On Sun, Dec 29, 2013 at 4:30 PM, larry google groups
<lawrencecloj...@gmail.com> wrote:
>> If it can't find the file, `clojure.java.io/resource` returns nil; and
>> (slurp
>> nil) throws an IllegalArgumentException, which doesn't seem to be the
>> error
>> you're getting.
>
>
> Thanks for that. But the app has no problem reading the schema.edn file when
> I start the app with:
>
> java -jar admin-1-standalone.jar
>
> So why would it have trouble reading the file when I'm in the repl?
>
>
>
> On Sunday, December 29, 2013 12:55:04 AM UTC-5, John Mastro wrote:
>>
>> Hi Larry,
>>
>> > 4.) load whatever file holds the (main-) function that starts the app.
>> > So for
>> > me, for instance, it might be: (load-file "src/admin/core.clj")
>>
>> I don't think the `load-file` should be necessary. Do things not work if
>> you
>> omit it?
>>
>> The code on disk when you jacked in will already have been loaded, so you
>> should only need to re-evaluate it (whether through cider/nrepl.el,
>> `load-file`, or what have you) if you've made subsequent changes. I tend
>> to use
>> `cider-eval-defun-at-point`, `cider-eval-last-sexp`, or
>> `cider-eval-region` to
>> evaluate just the code I've changed rather than reloading the whole file.
>> (Actually, lately I've been using the `tools.namespace`[1] approach a lot,
>> but
>> that's probably a separate topic).
>>
>> (Cider[2], by the way, is just nrepl.el's new name).
>>
>> > But when I want to work on this app at the REPL, the app seems unable to
>> > find
>> > the schema.edn file. You can see my REPL session below. The function
>> > (initiate-forms) has this line: (read-string (slurp
>> > (clojure.java.io/resource
>> > "config/schema.edn")))
>>
>> I'm not positive, but I don't think the issue is that it can't find
>> "config/schema.edn". What's the result of (clojure.java.io/resource
>> "config/schema.edn")?
>>
>> If it can't find the file, `clojure.java.io/resource` returns nil; and
>> (slurp
>> nil) throws an IllegalArgumentException, which doesn't seem to be the
>> error
>> you're getting.
>>
>> [1] https://github.com/clojure/tools.namespace
>> [2] https://github.com/clojure-emacs/cider
>>
>> - John
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@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 and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@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 and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to