(cleavir-cst-to-ast:cst-to-ast (cst:cst-from-expression '(let ((&rest 42)) &rest)) nil nil) signals a malformed-lambda-list error. This is because convert-let essentially rewrites the form as ((lambda (&rest) &rest) 42), which is invalid.
As far as I'm aware, binding lexical variables with names in lambda-list-keywords is legal. Eclector does it, which is how this was noticed.
As discussed in #clasp,
(cleavir-cst-to-ast:cst-to-ast (cst:cst-from-expression '(let ((&rest 42)) &rest)) nil nil)
signals amalformed-lambda-list
error. This is becauseconvert-let
essentially rewrites the form as((lambda (&rest) &rest) 42)
, which is invalid.As far as I'm aware, binding lexical variables with names in
lambda-list-keywords
is legal. Eclector does it, which is how this was noticed.