From f0df1ed0fdca7a63cffda5e53c968e814b7b06ec Mon Sep 17 00:00:00 2001 From: Daniel Llorens Date: Fri, 17 Mar 2023 21:03:33 +0100 Subject: Fix no-clause case-lambda in peval This is checked by optargs.test, which 3b47f87618047ebb8812788c64a44877a4f2e0dd broke. * module/language/tree-il/peval.scm (peval): Account for no clause (= no body) case-lambda. --- doc/ref/api-control.texi | 2 +- module/language/tree-il/peval.scm | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/ref/api-control.texi b/doc/ref/api-control.texi index 158ed8ad8..d024e14a5 100644 --- a/doc/ref/api-control.texi +++ b/doc/ref/api-control.texi @@ -1323,7 +1323,7 @@ exception handlers are invoked within the continuation of the error, without unwinding the stack. The dynamic environment of the handler call will be that of the @code{raise-exception} call, with the difference that the current exception handler will be ``unwound'' to the -\"outer\" handler (the one that was in place when the corresponding +``outer'' handler (the one that was in place when the corresponding @code{with-exception-handler} was called). However, it's often the case that one would like to handle an exception diff --git a/module/language/tree-il/peval.scm b/module/language/tree-il/peval.scm index 7c05e9a2e..36a3033b0 100644 --- a/module/language/tree-il/peval.scm +++ b/module/language/tree-il/peval.scm @@ -1671,6 +1671,7 @@ top-level bindings from ENV and return the resulting expression." (($ src-proc meta orig-body) ;; If there are multiple cases and one matches nargs, omit all the others. (or (and + orig-body (lambda-case-alternate orig-body) (let ((nargs (length orig-args))) (let loop ((body orig-body)) -- cgit v1.2.1