diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-13 00:01:28 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-13 00:01:28 +0200 |
commit | a82b6c772089aa46e30c6c89ef48f514294df3cb (patch) | |
tree | e25d9b6fd1fefe8b6ac293a5c0b53293872a8f54 /module/vcomponent | |
parent | Add basic documentation for lens. (diff) | |
parent | Even more documentation. (diff) | |
download | calp-a82b6c772089aa46e30c6c89ef48f514294df3cb.tar.gz calp-a82b6c772089aa46e30c6c89ef48f514294df3cb.tar.xz |
Merge branch 'next' into datarewrite-structures
Diffstat (limited to '')
-rw-r--r-- | module/vcomponent/control.scm | 37 | ||||
-rw-r--r-- | module/vcomponent/util/control.scm | 2 | ||||
-rw-r--r-- | module/vcomponent/util/search.scm | 3 |
3 files changed, 4 insertions, 38 deletions
diff --git a/module/vcomponent/control.scm b/module/vcomponent/control.scm deleted file mode 100644 index 19a6fa18..00000000 --- a/module/vcomponent/control.scm +++ /dev/null @@ -1,37 +0,0 @@ -(define-module (vcomponent util control) - :use-module (hnh util) - :use-module (vcomponent) - :export (with-replaced-properties)) - - -(eval-when (expand load) ; No idea why I must have load here. - (define href (make-procedure-with-setter hash-ref hash-set!)) - - (define (set-temp-values! table component kvs) - (for-each (lambda (kv) - (let ((key (car kv)) - (val (cadr kv))) - (when (prop component key) - (set! (href table key) (prop component key)) - (set! (prop component key) val)))) - kvs)) - - (define (restore-values! table component keys) - (for-each (lambda (key) - (and=> (href table key) - (lambda (val) - (set! (prop component key) val)))) - keys))) - -;; TODO what is this even used for? -(define-syntax with-replaced-properties - (syntax-rules () - [(G_ (component (key val) ...) - body ...) - - (let ((htable (make-hash-table 10))) - (dynamic-wind - (lambda () (set-temp-values! htable component (quote ((key val) ...)))) ; In guard - (lambda () body ...) - (lambda () (restore-values! htable component (quote (key ...))))))])) ; Out guard - diff --git a/module/vcomponent/util/control.scm b/module/vcomponent/util/control.scm index 0869543d..19a6fa18 100644 --- a/module/vcomponent/util/control.scm +++ b/module/vcomponent/util/control.scm @@ -26,7 +26,7 @@ ;; TODO what is this even used for? (define-syntax with-replaced-properties (syntax-rules () - [(_ (component (key val) ...) + [(G_ (component (key val) ...) body ...) (let ((htable (make-hash-table 10))) diff --git a/module/vcomponent/util/search.scm b/module/vcomponent/util/search.scm index e2057e9e..3c2d7663 100644 --- a/module/vcomponent/util/search.scm +++ b/module/vcomponent/util/search.scm @@ -175,6 +175,9 @@ (lambda (err proc fmt args data) ;; NOTE This is mostly a hack to see that we ;; actually check for the correct error. + ;; + ;; stream-ref quite unhelpfully throws this error as + ;; $3 = (wrong-type-arg stream-ref "beyond end of stream" () (#<stream>)) (unless (string=? fmt "beyond end of stream") (scm-error err proc fmt args data)) |