summaryrefslogtreecommitdiff
path: root/modules/language/python
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-09-23 23:43:02 +0200
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-09-23 23:43:02 +0200
commit6e22a121560613fb9074c26808f795feac548f18 (patch)
treed51be20a88b514b7c7d7ca05c9d5cdac0232a009 /modules/language/python
parent36860b09a57c5b954d27cfcd53979844aa188db6 (diff)
bugfixes
Diffstat (limited to 'modules/language/python')
-rw-r--r--modules/language/python/list.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/language/python/list.scm b/modules/language/python/list.scm
index 9517aeb..8514310 100644
--- a/modules/language/python/list.scm
+++ b/modules/language/python/list.scm
@@ -121,7 +121,7 @@
(vector-ref o n))
(define-method (pylist-ref (o <p>) n)
- ((ref o '__listref__) n))
+ ((ref o '__getitem__) n))
;;; SET
(define-method (pylist-set! (o <py-list>) nin val)
@@ -139,9 +139,12 @@
(vector-set! o n val))
(define-method (pylist-set! (o <p>) n val)
- ((ref o '__listset__) n val))
+ ((ref o '__setitem__) n val))
;;SLICE
+(define-method (pylist-slice (o <p>) n1 n2 n3)
+ ((ref o '__getslice__) n1 n2 n3))
+
(define-method (pylist-slice (o <py-list>) n1 n2 n3)
(define N (slot-ref o 'n))
(define (f n) (if (< n 0) (+ N n) n))
@@ -172,6 +175,9 @@
(pylist-slice (to-pylist o) n1 n2 n3))))
;;SUBSET
+(define-method (pylist-subset! (o <p>) n1 n2 n3 val)
+ ((ref o '__setslice__) n1 n2 n3 val))
+
(define-method (pylist-subset! (o <py-list>) n1 n2 n3 val)
(define N (slot-ref o 'n))
(define (f n) (if (< n 0) (+ N n) n))