eval: local-compile: Simplify.
authorRicardo Wurmus <rekado@elephly.net>
Tue, 4 Jun 2019 10:54:46 +0000 (12:54 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Tue, 4 Jun 2019 10:54:46 +0000 (12:54 +0200)
* modules/language/python/eval.scm (local-compile): Simplify.

modules/language/python/eval.scm

index 0d5d9d9..4cfd239 100644 (file)
@@ -120,17 +120,17 @@ global environment @var{global}."
   "Compile the expression @var{x} within the local environment @var{local} and
 global environment @var{global}."
   (if locals
-      (if globals
-          (apply ((@ (system base compile) compile)
-                  ((L local-wrap) x locals) #:env globals
-                          #:from 'scheme #:opts opts)
-                 ((L env-boxes) locals))
-          (apply ((@ (system base compile) compile) ((L local-wrap) x locals)
-                          #:env ((L env-module) locals)
-                          #:from 'scheme #:opts opts)
-                 ((L env-boxes) locals)))
-      ((@ (system base compile) compile) x #:env (current-module)
-               #:from 'scheme #:opts opts)))
+      (apply ((@ (system base compile) compile)
+              ((L local-wrap) x locals)
+              #:env (if globals
+                        globals
+                        ((L env-module) locals))
+              #:from 'scheme #:opts opts)
+             ((L env-boxes) locals))
+      ((@ (system base compile) compile)
+       x
+       #:env (current-module)
+       #:from 'scheme #:opts opts)))
 
 (define-syntax eval 
   (lambda (x)