Skip to content

peter-kehl/dbg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dbg

A Clojure library designed to trace evaluation of functions calls, macros and special forms. It indents any output.

It logs entering and leaving functions or macros/special forms. It indents them, along with any inner output - simple and pretty. You prefix function calls with dbgf or macros/special forms with dbg. It works without any extra parens (). Hence diffs are shorter, easier to read. Isn't that practical?

Usage

(dbgf function-name-or-function-generating-expression parameters-if-any...)
(dbg  macro-or-special-form-or-function-name parameters-if-any...)

dbgloop and dbgrecur

Those serve to replace loop and recur. However, in order to indent any output, they don't use tail recursion. Instead, they use stack. Hence they may run out of stack space for long iterations.

(dbgloop [initial bindings] forms...)
(dbgrecur [new binding values])

Clojars Project