[racket] editing racket code effectively

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Nov 15 21:05:12 EST 2011

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. 



Posted on the users mailing list.