I've just come across Jay McCarthy's blog series on continuation marks
where he uses this exact problem (keeping track of indentation level)
to illustrate the use of dynamic-wind, parameters, and continuation
marks.
http://jeapostrophe.github.com/blog/2012/07/16/cont-marks/
http://jeapostrophe.git
Thanks Jeremiah!
I took your idea and modified it slightly so that the let**-debug is
in the body of the parameterize. It works great.
Cheers,
Harry
(define indent-size (make-parameter 0))
(define-syntax let**-debug
(syntax-rules ()
[(let**-debug tmp a ...) (parameterize ([indent-size (+
On Wed, 22 Aug 2012, Harry Spier wrote:
I have a macro let**-debug (based on the let** macro from Matthias
Felliesen) which gives me timing information.
(define-syntax let**-debug
(syntax-rules ()
[(_ tmp body) (begin (displayln 'body) (time body))]
[(_ tmp a b ... body) (let ([tmp (begi
I have a macro let**-debug (based on the let** macro from Matthias
Felliesen) which gives me timing information.
(define-syntax let**-debug
(syntax-rules ()
[(_ tmp body) (begin (displayln 'body) (time body))]
[(_ tmp a b ... body) (let ([tmp (begin (displayln 'a) (time a))])
(let**-debu
4 matches
Mail list logo