[racket] editing racket code effectively

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

On 11/15/2011 05:45 PM, Neil Van Dyke wrote:
> David Vanderson wrote at 11/15/2011 08:33 PM:
>> - how to add temporary debugging statements
>
> I usually use "log-debug" or "printf".  See the documentation for how 
> to make "log-debug" appear if you're running outside of DrRacket.
>
>
So if I have:

(if (integer? 1)
     (bar)
     (baz))

And I want to log each (bar) call, I:
- highlight "(bar)"
- Alt-OpenParen
- type: begin (printf "calling bar")

Getting:

(if (integer? 1)
     (begin (printf "calling bar") (bar))
     (baz))

And if I want to disable the printf, put "#;" in front:

(if (integer? 1)
     (begin #;(printf "calling bar") (bar))
     (baz))

Is that how you would do it?


Posted on the users mailing list.