summaryrefslogtreecommitdiff
path: root/modules/language/python/module/python.scm
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-10-21 16:16:02 +0200
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-10-21 16:16:02 +0200
commit79f06168aa626017b56c67f7ea8f101f3d15e5d2 (patch)
tree66822e7b3bcda949a7455ae7bd56d8d39f39c637 /modules/language/python/module/python.scm
parente89fa22f6521aeaa03954ae5a7dcb99ed608ff28 (diff)
refactoring functional objects
Diffstat (limited to 'modules/language/python/module/python.scm')
-rw-r--r--modules/language/python/module/python.scm18
1 files changed, 9 insertions, 9 deletions
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
- (<p> <property> class-method static-method refq
- py-super-mac))
+ (<p> <property> 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 <applicable> )) #t)
(define-method (callable (x <primitive-generic>)) #t)
(define-method (callable (x <p>))
- (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 <p>) (cls <p>))
- (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))