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" wrote:
> Oh. I checked that that the expression
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 wrote:
> Here's a macro that does som
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 (get-extr
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 real?])
4 matches
Mail list logo