Re: Python-style doctests in Guile (implemented, please comment)

2017-07-31 Thread Chaos Eternal
Great job! I have a new idea using s-exps to define tests: simple way: (define-syntax define-examples (syntax-rules () ((_ e ...) (quote (e ...) then we can simply (read the-file) then (match e ((define-examples e ...)) (do-test e)) On Mon, Jul 31, 2017 at 3:35 AM Arne Babenhauserheide wr

Re: Python-style doctests in Guile (implemented, please comment)

2017-07-31 Thread Mark H Weaver
Hi Arne, Arne Babenhauserheide writes: > I implemented doctests in Guile which allow writing SRFI-64 tests > directly in the docstring. Here’s a minimal example: > > > (import (examples doctests)) > > (define (one) > "(test 'foo > (test-equal 1 (one)))" > 1) I

Re: Python-style doctests in Guile (implemented, please comment)

2017-07-31 Thread Panicz Maciej Godek
2017-07-31 14:51 GMT+02:00 Mark H Weaver : > Hi Arne, > > Arne Babenhauserheide writes: > > > I implemented doctests in Guile which allow writing SRFI-64 tests > > directly in the docstring. Here’s a minimal example: > > > > > > (import (examples doctests)) > > > > (define (one) > >

Re: Python-style doctests in Guile (implemented, please comment)

2017-07-31 Thread Arne Babenhauserheide
Hi Mark, String-literals are a problem I did hit, and I’d be happy to lose that problem without losing the ease of starting a procedure with tests which double as automatically verified documentation. Mark H Weaver writes: >> (import (examples doctests)) >> >> (define (one) >>

Re: Python-style doctests in Guile (implemented, please comment)

2017-07-31 Thread Arne Babenhauserheide
Chaos Eternal writes: > Great job! > > I have a new idea using s-exps to define tests: > simple way: > (define-syntax define-examples > (syntax-rules () ((_ e ...) (quote (e ...) > > then we can simply (read the-file) then (match e ((define-examples e ...)) > (do-test e)) So you’d write so

Re: Python-style doctests in Guile (implemented, please comment)

2017-07-31 Thread Chaos Eternal
No, I don't think so. First, s-exp itself can be very literal written just like the srfi-64: #+begin_src (test 'foo (test-equal 1 (one))) #+end_src the meanning of this code is very straightforward: do a test whether result of (one) equals to 1. and now with my