From 1e823a1762088e6a4fbf5bc0791d61b9d6c4b013 Mon Sep 17 00:00:00 2001 From: Stefan Israelsson Tampe Date: Tue, 12 Mar 2019 20:57:24 +0100 Subject: avoid circular dependency --- modules/language/python/def.scm | 7 +++---- modules/language/python/for.scm | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'modules') 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)))) -- cgit v1.2.3