summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/language/python/def.scm7
-rw-r--r--modules/language/python/for.scm14
2 files changed, 17 insertions, 4 deletions
diff --git a/modules/language/python/def.scm b/modules/language/python/def.scm
index 7e97d22..634daf4 100644
--- a/modules/language/python/def.scm
+++ b/modules/language/python/def.scm
@@ -1,7 +1,6 @@
(define-module (language python def)
#:use-module (ice-9 pretty-print)
#:use-module (oop pf-objects)
- #:use-module (language python for)
#:use-module (language python exceptions)
#:use-module (ice-9 match)
#:use-module (srfi srfi-11)
@@ -132,15 +131,15 @@
(string->symbol x)
x))))
+(define (mkw kw) (error "not implemented"))
+
(define-syntax m*
(syntax-rules (* ** =)
((_ (= a b))
(list (symbol->keyword 'a) b))
((_ (* a)) a)
((_ (** kw))
- (for ((k v : kw)) ((l '()))
- (cons* v (mk-k k) l)
- #:final (reverse l)))
+ (mkw kw))
((_ a) (list a))))
(define-syntax py-apply
diff --git a/modules/language/python/for.scm b/modules/language/python/for.scm
index cebb5d1..cff1baa 100644
--- a/modules/language/python/for.scm
+++ b/modules/language/python/for.scm
@@ -180,3 +180,17 @@
(set! (@@ (oop pf-objects) hashforeach)
(lambda (f d)
(for ((k v : d)) () (f k v))))
+
+(define (mk-k x)
+ (if (keyword? x)
+ x
+ (symbol->keyword
+ (if (string? x)
+ (string->symbol x)
+ x))))
+
+(set! (@@ (language python def) mkw)
+ (lambda (kw)
+ (for ((k v : kw)) ((l '()))
+ (cons* v (mk-k k) l)
+ #:final (reverse l))))