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

modules/language/python/eval.scm

index 3849b35..0d5d9d9 100644 (file)
   (GlobalModuleWrap mod))
                       
 
-(define* (local-eval x locals globals)
+(define (local-eval x locals globals)
   "Evaluate the expression @var{x} within the local environment @var{local} and
 global environment @var{global}."
   (if locals
-      (if globals
-          (apply (seval ((L local-wrap) x locals) globals)
-                 ((L env-boxes) locals))
-          (apply (seval ((L local-wrap) x locals) ((L env-module) locals))
-                 ((L env-boxes) locals)))
+      (apply (seval ((L local-wrap) x locals)
+                    (if globals
+                        globals
+                        ((L env-module) locals)))
+             ((L env-boxes) locals))
       (seval x (current-module))))
 
 (define* (local-compile x locals globals #:key (opts '()))