summaryrefslogtreecommitdiff
path: root/modules/language/python/def.scm
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2018-09-02 19:48:52 +0200
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2018-09-02 19:48:52 +0200
commit0f56fc6181a3167db9f45b8a042a8d2f56ade3a8 (patch)
tree19966c8557ecdd0024903b04157ee90e4af64d4f /modules/language/python/def.scm
parent3d44139af1b65ec71abafec939b5240d3821490b (diff)
refined the errors in the os module, translating scheme errors to python errors. close command changed
Diffstat (limited to 'modules/language/python/def.scm')
-rw-r--r--modules/language/python/def.scm16
1 files changed, 12 insertions, 4 deletions
diff --git a/modules/language/python/def.scm b/modules/language/python/def.scm
index b2a8de2..1f527e9 100644
--- a/modules/language/python/def.scm
+++ b/modules/language/python/def.scm
@@ -143,10 +143,18 @@
(define-syntax py-apply
(lambda (x)
- (syntax-case x (*)
- ((_ f a ... (* x))
- (and-map (lambda (x) (symbol? (syntax->datum x))) #'(a ...))
- #'(if (pair? x)
+ (syntax-case x ()
+ ((_ f a ... (op x))
+ (and (syntax-case #'op (*)
+ (* #t)
+ (_ #f))
+ (and-map (lambda (q)
+ (syntax-case q (* ** =)
+ ((= _ _) #f)
+ ((* _ ) #f)
+ ((** _ ) #f)
+ (_ #t))) #'(a ...)))
+ #'(if (or (null? x) (pair? x))
(apply f a ... x)
(apply f a ... (to-list x))))