3 ms·
> It’s so addictive to just paste new functions into a repl and see the changes instantly that it’s easy to go a few hours without committing and realize your c
by tonyarkles 4y ago
> It’s so addictive to just paste new functions into a repl and see the changes instantly that it’s easy to go a few hours without committing and realize your changes rely on a now-deleted function. :)
I think Slime is a pretty happy middle ground. Instead of just pasting, the function gets written in a source file and then C-c C-c to evaluate it in the repl. I did once or twice run into similar issues though from depending on older or newer versions of functions that changed but weren’t completely reflected until a clean restart. But that’s been pretty rare and definitely wasted way less time than “make clean all” before committing C++ code :D
- lokedhs 4y agoDoing a full reload of the system once in a while (especially after large changes) also helps. Just because you can keep a REPL open for days doesn't mean that's always the best idea.
- lispm 4y agoAnother way to deal with that is patching the running Lisp and "undefine" no longer needed functions, variables, classes, ...
- kaveh808 4y agoI have always found that a weak point. Is there an "opposite" key binding to C-c C-c than will undefine/unintern an entity?
- lispm 4y agoCan't remember what SLIME supports, but LispWorks has Undefine as an Editor command and in its Editor menus. It can undefine more than just functions.
- Jtsummers 4y agoC-c C-u is bound to `slime-undefine-function`, though it prompts you for the name of the function and doesn't determine it by the present context. `slime-unintern-symbol` is also present but not bound by default and also prompts for the name.
- weikju 4y agoyes this is the correct way, this IS repl-driven development.. The REPL is a entrypoint into the world of the running program, and ideally the editor is connected to the program via the REPL, but you still write code in the editor. Most Lisp beginner tutorials - the ones that don't start with teaching emacs - will ask the reader to just paste code into the REPL. This sets up bad habits... Perhaps we'll have better AND easier tutorials one day.
- kaveh808 4y agoBeginner CL video showing the use of Emacs & Slime: https://youtu.be/nSJcuOLmkl8 https://youtu.be/nSJcuOLmkl8