summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-09-16 21:33:05 +0200
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-09-16 21:33:05 +0200
commit97a5352dbd778b693d9fe8c14bdde94d3b58da68 (patch)
tree4ee926226e20ce4607f5c559a20e5530492e3598
parent7fa0e1dd09693f84f9189e2231228b722f88e8f7 (diff)
raise mixup
-rw-r--r--modules/language/python/compile.scm2
-rw-r--r--modules/language/python/list.scm6
-rw-r--r--modules/language/python/try.scm8
3 files changed, 10 insertions, 6 deletions
diff --git a/modules/language/python/compile.scm b/modules/language/python/compile.scm
index 332c22e..873b264 100644
--- a/modules/language/python/compile.scm
+++ b/modules/language/python/compile.scm
@@ -167,7 +167,7 @@
(define (fastfkn x)
(case x
;; Lists
- ((append) (L 'pylist-apbpend!))
+ ((append) (L 'pylist-append!))
((count) (L 'pylist-count!))
((extend) (L 'pylist-extend!))
((index) (L 'pylist-index))
diff --git a/modules/language/python/list.scm b/modules/language/python/list.scm
index 1935f02..8f734d8 100644
--- a/modules/language/python/list.scm
+++ b/modules/language/python/list.scm
@@ -4,6 +4,7 @@
#:use-module (language python exceptions)
#:use-module (language python yield)
#:use-module (language python for)
+ #:use-module (language python try)
#:use-module (language python exceptions)
#:export (to-list pylist-ref pylist-set! pylist-append!))
@@ -77,7 +78,7 @@
((ref o '__listset__) n val))
;;APPEND
-(define-method (pylist-append! (o <py-list>) n val)
+(define-method (pylist-append! (o <py-list>) val)
(let* ((n (slot-ref o 'n))
(vec (slot-ref o 'vec))
(N (vector-length vec)))
@@ -94,7 +95,8 @@
(lp (+ i 1)))))
(vector-set! vec2 n val)
(slot-set! o 'vec vec2)))
- (slot-set! o 'n (+ n 1))))
+ (slot-set! o 'n (+ n 1))
+ (values)))
(define-method (pylist-append! o n)
(raise 'NotSupportedOP '__append__))
diff --git a/modules/language/python/try.scm b/modules/language/python/try.scm
index 448c841..9778f3b 100644
--- a/modules/language/python/try.scm
+++ b/modules/language/python/try.scm
@@ -5,7 +5,8 @@
#:use-module (oop goops)
#:use-module (ice-9 control)
#:use-module (ice-9 match)
- #:export (raise try))
+ #:replace (raise)
+ #:export (try))
(define-syntax-rule (aif it p x y) (let ((it p)) (if it x y)))
@@ -92,8 +93,9 @@
(define raise
(case-lambda
- (() (raise Exception))
((x . l)
(if (pyclass? x)
(throw 'python (apply x l))
- (apply throw 'python x l)))))
+ (apply throw 'python x l)))
+
+ (() (raise Exception))))