summaryrefslogtreecommitdiff
path: root/modules/oop
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-10-01 13:49:42 +0200
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-10-01 13:49:42 +0200
commit0c1d43a631486f00ea26cb6eaa685509caf77d50 (patch)
treea2de1198039059bb91a2f5cfceed40d86136b7b3 /modules/oop
parent710573cbdb4365b02563fd1c01e5f7e78a9ed6de (diff)
generic function addition to property lookup
Diffstat (limited to 'modules/oop')
-rw-r--r--modules/oop/pf-objects.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/oop/pf-objects.scm b/modules/oop/pf-objects.scm
index 6847524..62c522b 100644
--- a/modules/oop/pf-objects.scm
+++ b/modules/oop/pf-objects.scm
@@ -9,7 +9,7 @@
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
- define-python-class get-type
+ define-python-class get-type py-class
))
#|
Python object system is basically syntactic suger otop of a hashmap and one
@@ -686,5 +686,9 @@ explicitly tell it to not update etc.
(code ...))))
(define (pyclass? x)
- (and (is-a? x <p>) (not (ref x '__class__))))
+ (and (is-a? x <p>)
+ (not (ref x '__class__))))
+
+(define-method (py-class (o <p>))
+ (ref o '__class__ 'type))