From 955540d6a0452c14d476bc166970024555c13b79 Mon Sep 17 00:00:00 2001 From: Stefan Israelsson Tampe Date: Fri, 22 Sep 2017 21:40:04 +0200 Subject: strings now sully supported --- modules/language/python/list.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules/language/python/list.scm') 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 )) (length l)) (define-method (len (v )) (vector-length v)) (define-method (len (s )) (string-length s)) -(define-method (len (o )) (slot-ref i 'n)) +(define-method (len (o )) (slot-ref o 'n)) (define-method (len (o

)) ((ref o '__len__))) (define-method (in x (l )) (member x l)) @@ -576,7 +577,7 @@ #f))) (define-method (in x (s )) - (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) -- cgit v1.2.3