Re: [racket] Enhancing a macro

2012-08-28 Thread Harry Spier
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

Re: [racket] Enhancing a macro

2012-08-23 Thread Harry Spier
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 (+

Re: [racket] Enhancing a macro

2012-08-22 Thread Jeremiah Willcock
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

[racket] Enhancing a macro

2012-08-22 Thread Harry Spier
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