Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Jan 7, 2025
1 parent 8fca7f9 commit 4597f38
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions compile.scm
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@
((not (pair? xs))
y)))

(define (relaxed-map f xs)
(if (pair? xs)
(cons
(f (car xs))
(relaxed-map f (cdr xs)))
(f xs)))

(define (relaxed-deep-map f xs)
(if (pair? xs)
(cons
Expand Down Expand Up @@ -871,7 +878,7 @@

(define (optimize-expression expression)
(if (pair? expression)
(let ((arguments (map optimize-expression (cdr expression)))
(let ((arguments (relaxed-map optimize-expression (cdr expression)))
(predicate (car expression)))
(cond
((eq? predicate '$$begin)
Expand Down Expand Up @@ -1521,6 +1528,6 @@
(filter
(lambda (pair) (library-symbol? (car pair)))
(macro-state-literals (macro-context-state macro-context))))
expression2))))))
expression3))))))

(main)

0 comments on commit 4597f38

Please sign in to comment.