4 ms·
(defmacro ic (expr) `(prog2 (format t "~&ic| ~A: " ',expr) (prin1 ,expr) (terpri))) This is a lisp macro that (1) ensures the
by reikonomusha 7y ago
(defmacro ic (expr)
`(prog2
(format t "~&ic| ~A: " ',expr)
(prin1 ,expr)
(terpri)))
This is a lisp macro that (1) ensures the debug statement is printed on a newline, (2) prints the expression that got evaluated in its originally read form, (3) prints the value readably, (4) prints a newline, (5) return EXPR. Conforms to ANSI Common Lisp. Works on all implementations. No cute logo or testing required.
If you want to inspect execution, interrupt it, resume it, look at the call stack, look at local variables, then you can use Lisp’s function called break. No external tool required. No installing a dependency or debugger. Works on all implementations.
(break "stop right there!")
- gruns 7y agoCute. As you can see from IceCream's source, a little more hackery is required to get things working smoothly in Python. =]