From 97a5352dbd778b693d9fe8c14bdde94d3b58da68 Mon Sep 17 00:00:00 2001 From: Stefan Israelsson Tampe Date: Sat, 16 Sep 2017 21:33:05 +0200 Subject: raise mixup --- modules/language/python/compile.scm | 2 +- modules/language/python/list.scm | 6 ++++-- modules/language/python/try.scm | 8 +++++--- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'modules') 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 ) n val) +(define-method (pylist-append! (o ) 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)))) -- cgit v1.2.3