diff options
author | Stefan Israelsson Tampe <stefan.itampe@gmail.com> | 2018-02-19 18:12:48 +0100 |
---|---|---|
committer | Stefan Israelsson Tampe <stefan.itampe@gmail.com> | 2018-02-19 18:12:48 +0100 |
commit | 0a6079db826621c32cdfc89c3daea217582f0bb7 (patch) | |
tree | 0caa325c4466978aa6015158a1cb7988286045ec /modules/language/python/list.scm | |
parent | 304b82e4bb9c5f85e293a7e0706e3448aec04574 (diff) |
os
Diffstat (limited to 'modules/language/python/list.scm')
-rw-r--r-- | modules/language/python/list.scm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/language/python/list.scm b/modules/language/python/list.scm index 0131328..5f4fbb7 100644 --- a/modules/language/python/list.scm +++ b/modules/language/python/list.scm @@ -174,16 +174,15 @@ (to-pylist l))) (define-method (pylist-slice (o <string>) n1 n2 n3) - (define N (slot-ref o 'n)) + (define N (string-length o)) (define (f n) (if (< n 0) (+ N n) n)) (let* ((n1 (f (if (eq? n1 None) 0 n1))) (n2 (f (if (eq? n2 None) (slot-ref o 'n) n2))) (n3 (f (if (eq? n3 None) 1 n3)))) (list->string - (map (lambda (x) (string-ref x 0)) - (to-list - (pylist-slice (to-pylist o) n1 n2 n3)))))) + (to-list + (pylist-slice (to-pylist o) n1 n2 n3))))) (defpair (pylist-slice o n1 n2 n3) |