summaryrefslogtreecommitdiff
path: root/modules/language/python/list.scm
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-09-19 23:34:25 +0200
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-09-19 23:34:25 +0200
commit0b86f96f0c3ca08f35b6bf87cbcb230fb12225e8 (patch)
tree645a169089bbae0f93c0f2613bba15462e7dab47 /modules/language/python/list.scm
parenta2632b522cd3dd48a9cd7315038660d8c85bc557 (diff)
simple python formatting now supported
Diffstat (limited to 'modules/language/python/list.scm')
-rw-r--r--modules/language/python/list.scm18
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/language/python/list.scm b/modules/language/python/list.scm
index f31fcba..3b7fbd5 100644
--- a/modules/language/python/list.scm
+++ b/modules/language/python/list.scm
@@ -65,6 +65,9 @@
(define-method (to-pylist (l <vector>))
(to-pylist (vector->list l)))
+(define-method (to-pylist (o <string>))
+ (to-pylist (string->list o)))
+
(define-method (to-pylist l)
(if (null? l)
(let ((o (make <py-list>)))
@@ -125,8 +128,19 @@
'()))))
(to-pylist l)))
-(define-method (pylist-slice o n1 n2 n3)
- (pylist-slice (to-pylist o) n1 n2 n3))
+(define-method (pylist-slice (o <string>) n1 n2 n3)
+ (list->string
+ (to-list
+ (pylist-slice (to-pylist o) n1 n2 n3))))
+
+(define-method (pylist-slice (o <pair>) n1 n2 n3)
+ (to-list
+ (pylist-slice (to-pylist o) n1 n2 n3)))
+
+(define-method (pylist-slice (o <vector>) n1 n2 n3)
+ (list->vector
+ (to-list
+ (pylist-slice (to-pylist o) n1 n2 n3))))
;;SUBSET
(define-method (pylist-subset! (o <py-list>) n1 n2 n3 val)