unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#72382: srfi-64: test-with-runner requires some decl-or-expr
@ 2024-07-30 19:51 Tomas Volf
  2024-10-01 23:02 ` Taylan Kammer
  0 siblings, 1 reply; 2+ messages in thread
From: Tomas Volf @ 2024-07-30 19:51 UTC (permalink / raw)
  To: 72382

Hello,

I think I found a bug in (srfi srfi-64) module shipped with GNU Guile.

test-with-runner has following signature:

    (test-with-runner runner decl-or-expr ...)

That, according to syntax-case rules (and how test-apply works with the same
definition) should mean that it accepts 0 or more decl-or-expr.  However that
does not seem to be the case:

    (use-modules (srfi srfi-64))
    (let ((r (test-runner-null)))
      (test-with-runner r))

Leading to:

    ;;; Syntax error:
    ;;; unknown location: lambda: bad lambda in form (lambda ())
    ice-9/psyntax.scm:2824:12: In procedure syntax-violation:
    Syntax error:
    unknown location: lambda: bad lambda in form (lambda ())

Have a nice day
Tomas Volf





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#72382: srfi-64: test-with-runner requires some decl-or-expr
  2024-07-30 19:51 bug#72382: srfi-64: test-with-runner requires some decl-or-expr Tomas Volf
@ 2024-10-01 23:02 ` Taylan Kammer
  0 siblings, 0 replies; 2+ messages in thread
From: Taylan Kammer @ 2024-10-01 23:02 UTC (permalink / raw)
  To: Tomas Volf, 72382

On 30.07.2024 21:51, Tomas Volf wrote:
> Hello,
>
> I think I found a bug in (srfi srfi-64) module shipped with GNU Guile.
>
> test-with-runner has following signature:
>
>     (test-with-runner runner decl-or-expr ...)
>
> That, according to syntax-case rules (and how test-apply works with the same
> definition) should mean that it accepts 0 or more decl-or-expr.  However that
> does not seem to be the case:
>
>     (use-modules (srfi srfi-64))
>     (let ((r (test-runner-null)))
>       (test-with-runner r))
>
> Leading to:
>
>     ;;; Syntax error:
>     ;;; unknown location: lambda: bad lambda in form (lambda ())
>     ice-9/psyntax.scm:2824:12: In procedure syntax-violation:
>     Syntax error:
>     unknown location: lambda: bad lambda in form (lambda ())
>
> Have a nice day
> Tomas Volf
>
>
Should be easy to fix by adding a preceding arm to the syntax-rules, explicitly handling the case of zero decl-or-expr elements as a no-op.

I've just done that in my implementation:

    https://codeberg.org/taylan/scheme-srfis/commit/5e34f47f383fd5a35c88a52bd1d32a65a49b7f0a

- Taylan






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-01 23:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30 19:51 bug#72382: srfi-64: test-with-runner requires some decl-or-expr Tomas Volf
2024-10-01 23:02 ` Taylan Kammer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).