Skip to content

Commit

Permalink
Enhance comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jpellegrini committed Jun 2, 2024
1 parent d00e90e commit cd6c597
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/comprewrite.stk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down Expand Up @@ -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)
;;
Expand Down

0 comments on commit cd6c597

Please sign in to comment.