2 ms·
Lisp will tell you if it can, by dropping you in a breakloop. A breakloop is a repl that includes all of the normal Lisp repl features plus the full stack and d
by mikelevins 4y ago
Lisp will tell you if it can, by dropping you in a breakloop. A breakloop is a repl that includes all of the normal Lisp repl features plus the full stack and dynamic environment of the broken code (which you can inspect and edit), plus a set of restarts you can select to resume execution, abandon the broken function, or transfer control in some other way defined by the context of the breakloop (which you can customize to your heart's content).
Smalltalk has equivalent features.
Lisp won't catch every possible error you could possibly make, of course, so testing is good defensive programming.
On the other hand, when I'm working in Lisp, testing happens almost by default. It's the majority of what I do: I write experiments in files and hit a key to send them to the repl to test what happens.
Tests generally start as little experiments like this. Some of them are useful over and over. Those graduate from informal experiments to formal tests.