Re: GNU Guile 3.0.11 released

Tomas Volf <[email protected]> Tue, 16 Dec 2025 20:01:56 +0100
Newsgroups gmane.lisp.guile.devel
Message-ID <[email protected]>
--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Rob Browning <[email protected]> writes:

> 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.

Your guess is as good as mine :) But I did read it as a formal macro
pattern.

Only use case I can think of for no body is to run the clean-up
conditionally, based on current skip specifiers.  But that seems pretty
niche, and it is achievable by using #t for decl-or-expr, if required.

> 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.

I think allowing this would mask bugs, even the GnuCash fixed it with
"it revealed a couple of misplaced closing parens".  I have no strong
opinion on special-casing the missing test body, should I send a patch?

Tomas

=2D-=20
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmlBrKQOHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/wakHMRAArayRkr1YbUV43WH3tHx5IimTSH9/MIQqzXPN
9jF5vYfVX5/w3AGJjuHIEOfWIS6T+0FpNtBt1Av8XttU7sAH2t55oAgcB/zwPQte
m9+kJic3O9yDYJV8DcPn3B94JRsUftBXCt+tJEPHrVXcfViNeIhoj7ou4kGgUiFl
EKU+GOytnP/qqzTclw4b8UR0RbJfUivbXPjhmjkQ8A4F0O1qVhsgoq2ZKy884yQw
tf5bMq+qQNBRLazAQQPLBBFtHH5PqnJQuCTUfUwRkUV81Nxqs7AOlg3OMga32kg6
yElg1PKRhZBXC8CQ8tRBb5OKI589ce+KUCUaKFv/JX0Sgc54T+IGSlbWVSxaLRbD
Vfzqt0fO3F0XW+3W+bdu+MquttmVo+qAi5Zour2WdfuMN80DKTd/2uDViedCa5UW
waVhZxm1L2W6EtlyBIYg+Ckch5RjKLqgVmWcTCQAwlwSe/xb4v2pF7A7dZ/sA5Ho
TVVXvSldD3BmdKS5U2EvgrbdJMDOGLq528S5pTzutHfiKcMH1h+ssuDclUFbI3Ya
zHNUhpoIxniKG/lpvs1JtjUKqJW7j4USIMfcn3Qzeo462lLU+jBKlg1FI9WUfmy+
VM+Wf2KlJHKt6/XWzgusf9Ka76V1HFoGMe0AnY4wdzIPZa1EYFyiqoB9AW5Z1Mrj
C+pag+M=
=Fpe5
-----END PGP SIGNATURE-----
--=-=-=--