Tomas Volf <[email protected]> writes:

> The specification basically just says that
>
> --8<---------------cut here---------------start------------->8---
> (test-group suite-name decl-or-expr ...)
>
> Equivalent to:
>
> (if (not (test-to-skip% suite-name))
>   (dynamic-wind
>     (lambda () (test-begin suite-name))
>     (lambda () decl-or-expr ...)
>     (lambda () (test-end suite-name))))
> --8<---------------cut here---------------end--------------->8---

I did wonder whether the "..." in the spec was meant as a formal macro
pattern, or meant it more informally, and perhaps didn't mean to allow
"none" such that

  (test-group-with-cleanup "foo" something)

treats something as cleanup, which I suspect might more often hide a
mistake than anything else.

In any case, if it does mean for "..." to mean zero or more, and really
does intend the (lambda () declr-or-expr ...) expansion, then I wonder
if we could and might want to add an explicit error for "no body"
instead of expanding to (lambda ()), which currently fails in a more
mysterious way.  For example:

  (define-syntax test-group
    (syntax-rules ()
      ((_ suite-name) (syntax-error "Empty test-group body"))
      ...))

We could also augment test-group-with-cleanup to do something similar
when there's no body.

Alternately, I suppose we could consider allowing the empty body via an
expansion of (lambda () #f decl-or-expr ...) if we didn't think that was
forbidden.

Thanks
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4

Reply via email to