diff options
author | Stefan Israelsson Tampe <stefan.itampe@gmail.com> | 2017-09-22 21:40:04 +0200 |
---|---|---|
committer | Stefan Israelsson Tampe <stefan.itampe@gmail.com> | 2017-09-22 21:40:04 +0200 |
commit | 955540d6a0452c14d476bc166970024555c13b79 (patch) | |
tree | 23515427dbb6a39ae02db4a0e04c4b39e40f4ee8 /modules/language/python/list.scm | |
parent | e80fec5e48604920c52173cb9a436ac38215dfc0 (diff) |
strings now sully supported
Diffstat (limited to 'modules/language/python/list.scm')
-rw-r--r-- | modules/language/python/list.scm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/language/python/list.scm b/modules/language/python/list.scm index a88aa0a..498934f 100644 --- a/modules/language/python/list.scm +++ b/modules/language/python/list.scm @@ -10,7 +10,8 @@ #:export (to-list pylist-ref pylist-set! pylist-append! pylist-slice pylist-subset! pylist-reverse! pylist-pop! pylist-count pylist-extend! len in - pylist-insert! pylist-remove! pylist-sort!)) + pylist-insert! pylist-remove! pylist-sort! + pylist-index)) (define-syntax-rule (aif it p x y) (let ((it p)) (if it x y))) @@ -562,7 +563,7 @@ (define-method (len (l <pair> )) (length l)) (define-method (len (v <vector>)) (vector-length v)) (define-method (len (s <string>)) (string-length s)) -(define-method (len (o <py-list>)) (slot-ref i 'n)) +(define-method (len (o <py-list>)) (slot-ref o 'n)) (define-method (len (o <p>)) ((ref o '__len__))) (define-method (in x (l <pair>)) (member x l)) @@ -576,7 +577,7 @@ #f))) (define-method (in x (s <string>)) - (let ((n (string-length l)) + (let ((n (string-length s)) (x (if (string? x) (string-ref x 0) x))) (let lp ((i 0)) (if (< i n) |