diff options
Diffstat (limited to 'modules/oop/pf-objects.scm')
-rw-r--r-- | modules/oop/pf-objects.scm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/modules/oop/pf-objects.scm b/modules/oop/pf-objects.scm index 323abfd..cb4d3c6 100644 --- a/modules/oop/pf-objects.scm +++ b/modules/oop/pf-objects.scm @@ -4,7 +4,7 @@ #:use-module (ice-9 match) #:export (set ref make-pf <p> <py> <pf> <pyf> call with copy fset fcall make-p put put! - pcall pcall! get fset-x pyclass? + pcall pcall! get fset-x pyclass? refq 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 @@ -187,10 +187,31 @@ explicitly tell it to not update etc. (unx mrefx-py mref-py) (unx mrefx-py- mref-py-) +(define-syntax-rule (unx mrefx- mref-) + (define-syntax-rule (mref- x key l) + (let ((xx x)) + (let ((res (mrefx- xx key l))) + (if (and (not (struct? res)) + (not (pyclass? res)) + (procedure? res)) + (lambda z + (apply res xx z)) + res))))) + +(unx mrefx- mref-q) +(unx mrefx mrefq) +(unx mrefx-py mref-pyq) +(unx mrefx-py- mref-py-q) + (define-method (ref (x <pf> ) key . l) (mref x key l)) (define-method (ref (x <p> ) key . l) (mref- x key l)) (define-method (ref (x <pyf>) key . l) (mref-py x key l)) (define-method (ref (x <py> ) key . l) (mref-py- x key l)) + +(define-method (refq (x <pf> ) key . l) (mrefq x key l)) +(define-method (refq (x <p> ) key . l) (mref-q x key l)) +(define-method (refq (x <pyf>) key . l) (mref-pyq x key l)) +(define-method (refq (x <py> ) key . l) (mref-py-q x key l)) ;; the reshape function that will create a fresh new pf object with less size ;; this is an expensive operation and will only be done when we now there is |