|
|
|
|
|
by lukev
4750 days ago
|
|
Most Clojureists write code they want to keep in their source file, and then evaluate it by using their editors tooling to send it to the REPL from there. I usually just type things into the REPL for one-off exploration or experimentation. What editor are you using? Emacs certainly has had the most mindshare so far, but it's a beast to get started with. I recommend CounterClockwise for non-emacs folks: it's got all the features you need to be effective, and has full integration with Leiningen. As far as errors and error messages; yeah, it's hard, and a lot if it is just getting experience. But one thing that will really help you out is to write your program in very small chunks, and test each part as you go. That way, when something goes wrong, you'll have a very good idea about where to start looking. |
|
Your last paragraph is good advice, but IMO I code like that in general. Consider this code:
(-> x doSomething1 doSomething2 doSomething3)
This was tested as I went, but after the fact, I had to change x. Now any part of the whole series of steps could be broken. This is where I spend 15 minutes trying to understand what the error message means. shrug Maybe this is just what's expected when you're new to clojure.