diff --git a/lib/comprewrite.stk b/lib/comprewrite.stk index 765202b6..68b62bdf 100644 --- a/lib/comprewrite.stk +++ b/lib/comprewrite.stk @@ -180,7 +180,7 @@ (define (no-srfi-5-let? form) ;; form = (LET A B ...) ;; (CADR form) = A - ;; (CAADR form (CAR A) + ;; (CAADR form) = (CAR A) (or (not (pair? (cadr form))) ; named LET, not SRFI-5 LET (list? (caadr form)))) ; CAR of bindings is list, not SRFI-5 LET @@ -196,7 +196,7 @@ (else #f))) ;; (internal-shadow? bindings) will check if the bindings would -;; LET their own variable definition if truned into a LET*. +;; LET their own variable definition if turned into a LET*. ;; For example: ;; ;; (let ((a 10) @@ -253,7 +253,12 @@ ;; See that the bodies of the LETs are appended, reflecting the order ;; in which the expressions would be executed. ;; -;; Shadowing LETs are not optimized, as this can lead to wrong results. +;; These are not optimized, as this can lead to wrong results: +;; - a LET that would shadow a variable in an outer let +;; - a LET that uses a symbol that it also defines: +;; (LET ((a ...) (b ... a ...)) ...) +;; - SRFI-5 LETs +;; - named LETs (define (join-lets expression) ;; (let1 bindings1 (let2 bindings2 . body2) . body1) ;;