1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Fix no-clause case-lambda in peval

This is checked by optargs.test, which 3b47f87618
broke.

* module/language/tree-il/peval.scm (peval): Account for no clause (= no body)
  case-lambda.
This commit is contained in:
Daniel Llorens 2023-03-17 21:03:33 +01:00
parent 3b47f87618
commit f0df1ed0fd
2 changed files with 2 additions and 1 deletions

View file

@ -1323,7 +1323,7 @@ exception handlers are invoked within the continuation of the error,
without unwinding the stack. The dynamic environment of the handler without unwinding the stack. The dynamic environment of the handler
call will be that of the @code{raise-exception} call, with the call will be that of the @code{raise-exception} call, with the
difference that the current exception handler will be ``unwound'' to 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). @code{with-exception-handler} was called).
However, it's often the case that one would like to handle an exception However, it's often the case that one would like to handle an exception

View file

@ -1671,6 +1671,7 @@ top-level bindings from ENV and return the resulting expression."
(($ <lambda> src-proc meta orig-body) (($ <lambda> src-proc meta orig-body)
;; If there are multiple cases and one matches nargs, omit all the others. ;; If there are multiple cases and one matches nargs, omit all the others.
(or (and (or (and
orig-body
(lambda-case-alternate orig-body) (lambda-case-alternate orig-body)
(let ((nargs (length orig-args))) (let ((nargs (length orig-args)))
(let loop ((body orig-body)) (let loop ((body orig-body))