3 ms·
Yep. Thats what I do too. For emacs users, 'eval-region' and 'eval-expression' are your friends.
by reddit_clone 6y ago
Yep. Thats what I do too.
For emacs users, 'eval-region' and 'eval-expression' are your friends.
- jetti 6y agoIf you are doing Clojure development in emacs CIDER makes things super easy. Loading files or buffers into a repl as well as eval region and sexp (there are a ton more features but those are the main ones I use) Edit: I should have included a link for CIDER: https://cider.mx/ https://cider.mx/
- Jtsummers 6y agoAnd if you have language support in org, use an org file. #+BEGIN_SRC lisp (+ 1 2) #+END_SRC #+RESULTS: : 3 (type C-c C-c inside the source block) If you use noweb it'll also include referenced blocks in the evaluated unit: #+NAME: foo #+BEGIN_SRC lisp (defun foo (n) (+ 1 n)) #+END_SRC #+BEGIN_SRC lisp :noweb yes <<foo>> (foo 2) #+END_SRC #+RESULTS: : 3 This lets you have many versions of code in one file (if that's a sensible thing for you, very useful when exploring a new library or concept though), and in the end you can aggregate it all into one source file for sharing with others: #+BEGIN_SRC lisp :tangle foo.lisp <<foo>> <<bar>> #+END_SRC (type C-c C-v C-t to create the file) I've mainly used this (for interactive development) with Common Lisp, but it should work for most other languages that offer similar interactivity.