From c653e3aca875247001fc49ac3c7b51f3b4771698 Mon Sep 17 00:00:00 2001 From: Stefan Israelsson Tampe Date: Wed, 11 Apr 2018 22:02:17 +0200 Subject: io compiles --- modules/language/python/string.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'modules/language/python/string.scm') diff --git a/modules/language/python/string.scm b/modules/language/python/string.scm index 11a9737..084d933 100644 --- a/modules/language/python/string.scm +++ b/modules/language/python/string.scm @@ -23,7 +23,15 @@ (define-syntax-rule (aif it p x y) (let ((it p)) (if it x y))) -(define (scm-str x) (slot-ref (pystring x) 'str)) +(define (scm-str x) + (cond + ((string? x) + x) + ((is-a? x ) + (slot-ref (pystring x) 'str)) + (else + #f))) + (define (scm-sym x) (if (symbol? x) x -- cgit v1.2.3