diff options
Diffstat (limited to 'modules/oop/pf-objects.scm')
-rw-r--r-- | modules/oop/pf-objects.scm | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/modules/oop/pf-objects.scm b/modules/oop/pf-objects.scm index ecb94f6..44674fb 100644 --- a/modules/oop/pf-objects.scm +++ b/modules/oop/pf-objects.scm @@ -2,12 +2,13 @@ #:use-module (oop goops) #:use-module (ice-9 vlist) #:export (set ref make-pf <pf> call with copy fset fcall make-p put put! - pcall pcall! get + pcall pcall! get next mk def-pf-class mk-pf-class make-pf-class def-p-class mk-p-class make-p-class def-pyf-class mk-pyf-class make-pyf-class - def-py-class mk-py-class make-py-class)) + def-py-class mk-py-class make-py-class + StopIteration)) #| Python object system is basically syntactic suger otop of a hashmap and one @@ -553,4 +554,12 @@ explicitly tell it to not update etc. it (error "not a class"))) - +(define StopIteration (list 'StopIteration)) +(define-method (next (o <p>)) + (catch StopIteration + (lambda () ((ref o '__next__))) + (lambda (x) #:nil))) + + + + |