From 08d2847767cb14aa45a68a2c30d03dea84d47f84 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 30 Aug 2021 16:15:57 +0900 Subject: [PATCH] explicitly state that it is an error if the default values mutate the let-optionals list (issue #778) --- lib/chibi/optional.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/chibi/optional.scm b/lib/chibi/optional.scm index b310d8cc..97dc86f7 100644 --- a/lib/chibi/optional.scm +++ b/lib/chibi/optional.scm @@ -28,6 +28,9 @@ ;;> elements of \var{ls} beyond the length of \var{ls}, otherwise any ;;> extra values are unused. ;;> +;;> \var{ls} is evaluated only once. It is an error if any +;;> \var{default} mutates \var{ls}. +;;> ;;> Typically used on the dotted rest list at the start of a lambda, ;;> \scheme{let-optionals} is more concise and more efficient than ;;> \scheme{case-lambda} for simple optional argument uses.