[racket] editing racket code effectively

From: David Vanderson (david.vanderson at gmail.com)
Date: Tue Nov 15 21:09:15 EST 2011


On 11/15/2011 06:05 PM, Matthias Felleisen wrote:
>
> 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.
>
Great tip!  When you want to temporarily disable a particular (tee) 
call, do you remove it entirely?  Or rename "tee" to a different 
function that returns v without the displayln?


Posted on the users mailing list.