summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/language/python/eval.scm22
1 files changed, 8 insertions, 14 deletions
diff --git a/modules/language/python/eval.scm b/modules/language/python/eval.scm
index 4cfd239..9f8724f 100644
--- a/modules/language/python/eval.scm
+++ b/modules/language/python/eval.scm
@@ -15,8 +15,6 @@
(define seval (@ (guile) eval))
-(define-syntax-rule (aif it p x y) (let ((it p)) (if it x y)))
-
(define-syntax-rule (L x) (@@ (ice-9 local-eval) x))
(define-syntax globals
@@ -142,24 +140,20 @@ global environment @var{global}."
(define (comp x) (error "not implemented"))
-(define* (eval0 x #:optional (locals #f) (globals #f))
+(define* (eval0 x #:optional locals globals)
(cond
((string? x)
- (aif xp (p x)
- (aif cp (comp xp)
- (local-eval cp locals globals)
- (raise SyntaxError))
- (raise SyntaxError)))
+ (or (and=> (and=> (p x) comp)
+ (lambda (cp)
+ (local-eval cp locals globals)))
+ (raise SyntaxError)))
((pair? x)
(local-eval x locals globals))))
(define* (compile x filename mode
#:optional (flags 0) (dont_inherit #f) (optimize -1))
- (aif xp (p x)
- (aif cp (comp xp)
- cp
- (raise SyntaxError))
- (raise SyntaxError)))
+ (or (and=> (p x) comp)
+ (raise SyntaxError)))
(define-syntax exec
(lambda (x)
@@ -169,5 +163,5 @@ global environment @var{global}."
((exec x . l)
#'(exec0 x . l)))))
-(define* (exec0 x #:optional (locals #f) (globals #f))
+(define* (exec0 x #:optional locals globals)
(local-eval x locals globals))