[racket] editing racket code effectively
On Nov 15, 2011, at 8:33 PM, David Vanderson wrote:
> - how to add temporary debugging statements
I prefer to use a function that is in one of my standard libraries:
(define (tee tag v)
(displayln `(,tag ,v))
v)
To use it, wrap an expression like this to see what its value is:
(tee 'find-best-strategy-1
(find-best-strategy game-tree))
If also want to see the argument, I use two tees:
(tee 'find-best-strategy-1
(find-best-strategy (tee 'find-best-strategy1-arg game-tree)))
;; ---
Otherwise #; as mentioned.