diff --git a/src/ikarus.boot b/src/ikarus.boot index 036d307..d4c00ad 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/ikarus.compiler.ss b/src/ikarus.compiler.ss index a8c3e0d..a9e1a09 100644 --- a/src/ikarus.compiler.ss +++ b/src/ikarus.compiler.ss @@ -627,6 +627,11 @@ (Expr x)) +(define simple-primitives + ;;; primitives that are side-effect-free + ;;; FIXME: surely something must go here, no? + '()) + (define (optimize-letrec x) (define who 'optimize-letrec) (define (extend-hash lhs* h ref) @@ -738,14 +743,14 @@ cls*) #f)] [(primcall rator rand*) - (when (memq rator '(call/cc call/cf)) + (unless (memq rator simple-primitives) (comp)) (make-primcall rator (E* rand* ref comp))] [(funcall rator rand*) (let ([rator (E rator ref comp)] [rand* (E* rand* ref comp)]) (record-case rator [(primref op) - (when (memq op '(call/cc call/cf)) + (unless (memq op simple-primitives) (comp))] [else (comp)])