From 79f06168aa626017b56c67f7ea8f101f3d15e5d2 Mon Sep 17 00:00:00 2001 From: Stefan Israelsson Tampe Date: Sat, 21 Oct 2017 16:16:02 +0200 Subject: refactoring functional objects --- modules/language/python/module/python.scm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'modules/language/python/module') diff --git a/modules/language/python/module/python.scm b/modules/language/python/module/python.scm index bd68841..02f4e5e 100644 --- a/modules/language/python/module/python.scm +++ b/modules/language/python/module/python.scm @@ -3,8 +3,8 @@ #:use-module (ice-9 match) #:use-module (ice-9 readline) #:use-module ((oop pf-objects) #:select - (

class-method static-method refq - py-super-mac)) + (

class-method static-method ref + py-super-mac type object pylist-ref)) #:use-module (language python exceptions ) #:use-module (language python def ) #:use-module (language python for ) @@ -35,7 +35,7 @@ SyntaxError len dir next dict None property range tuple bytes bytearray eval locals globals - compile exec type + compile exec type object ) #:export (print repr complex float int @@ -76,7 +76,7 @@ (define-method (callable (x )) #t) (define-method (callable (x )) #t) (define-method (callable (x

)) - (refq x '__call__)) + (ref x '__call__)) (define chr integer->char) @@ -100,17 +100,17 @@ (define miss ((@ (guile) list) 'miss)) (define* (getattr a b #:optional (k miss)) - (let ((r (refq a (symbol->string b) k))) + (let ((r (ref a (symbol->string b) k))) (if (eq? r miss) (raise AttributeError "object/class ~a is missing attribute ~a" a b) r))) (define (hasattr a b) - (let ((r (refq a (symbol->string b) miss))) + (let ((r (ref a (symbol->string b) miss))) (not (eq? r miss)))) (define-method (issubclass (sub

) (cls

)) - (aif it (ref cl '__subclasscheck__) + (aif it (ref cls '__subclasscheck__) (it sub) (is-a? (ref sub '__goops__) (ref cls '__goops__)))) @@ -121,13 +121,13 @@ (or (isinstance o (car cl)) (isinstance o (cdr cl))) - (is-a? (ref (ref o '__class__) '__goops__) cl))) + (is-a? (ref (ref o '__class__) '__goops__) cl)))) (define iter (case-lambda ((o) (aif it (wrap-in o) it - (aif get (refq o '__getitem__) + (aif get (ref o '__getitem__) (make-generator iter (lambda (yield) (for () ((i 0)) -- cgit v1.2.3