Re: [racket-users] Macro to extract select subexpressions into other locations

2015-07-21 Thread Alexander D. Knauth
Here's a macro that does something similar: #lang at-exp racket (require (for-syntax syntax/parse racket/contract )) (begin-for-syntax (define (get-extracted-exprs-box extracted-exprs-id) (syntax-local-value extracted-exprs-id)) (define

Re: [racket-users] Macro to extract select subexpressions into other locations

2015-07-21 Thread Alexander D. Knauth
Oh. I checked that that the expressions were accumulating in the definition of extract-expression, but I didn't check that it expanded in the right order to do what you want. So this doesn't actually work. On Jul 21, 2015, at 3:08 PM, Alexander D. Knauth alexan...@knauth.org wrote: Here's a

Re: [racket-users] Macro to extract select subexpressions into other locations

2015-07-21 Thread Matthias Felleisen
Why not step back and design a notation where testing and documenting can share concepts instead of retro-actively extracting expressions from one place to put somewhere else. -- Matthias On Jul 21, 2015, at 3:23 PM, Alexander D. Knauth alexan...@knauth.org wrote: Oh. I checked that

[racket-users] Macro to extract select subexpressions into other locations

2015-07-20 Thread Jack Firth
I'm trying to create a way to automatically turn test cases into examples. I'd like a macro that turns this: (extract-expressions (module+ test (check-equal? (extract-expression (square 5)) 25) (check-equal? (extract-expression (square -5)) 25)) (module+ doc @defproc[(square [x