diff options
| author | Arun Isaac | 2025-11-17 18:15:10 +0000 |
|---|---|---|
| committer | Arun Isaac | 2025-11-17 18:15:10 +0000 |
| commit | 5b2bc2d146e7b58f15e1bc653291b71d8376b763 (patch) | |
| tree | a4c157ef220010f746da6dfb88836833ba0a1568 /bin | |
| parent | 020c771c18eb9d9208029b5f693944f5c35e92ff (diff) | |
| download | run64-5b2bc2d146e7b58f15e1bc653291b71d8376b763.tar.gz run64-5b2bc2d146e7b58f15e1bc653291b71d8376b763.tar.lz run64-5b2bc2d146e7b58f15e1bc653291b71d8376b763.zip | |
Use cond-expand to find the right match library.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/run64 | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/bin/run64 b/bin/run64 index c38682f..3c98ec0 100755 --- a/bin/run64 +++ b/bin/run64 @@ -22,12 +22,14 @@ (rnrs programs) (rnrs records syntactic) (srfi srfi-1) - (srfi srfi-64) - ;; We prefix (chibi match) imports with chibi: so as to not - ;; conflict with match bindings provided by the - ;; implementation. We should find a better solution, if at all - ;; possible. - (prefix (chibi match) chibi:)) + (srfi srfi-64)) + +;; We prefix match imports with run64: so as to not conflict with match bindings +;; provided by the implementation. We should find a better solution, if at all +;; possible. +(cond-expand + (guile (import (prefix (ice-9 match) run64:))) + (else (import (prefix (chibi match) run64:)))) (define-record-type (<highlit> highlit highlit?) (fields (immutable contents highlit-contents))) @@ -35,7 +37,7 @@ (define-record-type (<nothing> nothing nothing?)) (define (assq-ref alist key) - (chibi:match (assq key alist) + (run64:match (assq key alist) ((_ . value) value) (#f #f))) @@ -125,7 +127,7 @@ given string in an ANSI escape code." ;; Open the list. (display opener) (let ((child-column (+ (string-length opener) column))) - (chibi:match lst + (run64:match lst ;; If an empty list, close without doing anything else. (() (display ")")) @@ -207,11 +209,11 @@ given string in an ANSI escape code." "Like @code{map}, but does not stop when the end of the shortest list is reached. @var{proc} calls beyond the end of shorter lists are passed a @code{<nothing>} object instead of the list element." - (let ((heads (map (chibi:match-lambda + (let ((heads (map (run64:match-lambda ((head _ ...) head) (() (nothing))) lists)) - (tails (map (chibi:match-lambda + (tails (map (run64:match-lambda ((_ tail ...) tail) (() '())) lists))) @@ -251,7 +253,7 @@ object instead of the list element." (headline "test session starts" bold) (test-with-runner runner (for-each load - (chibi:match args + (run64:match args ((_ files ...) files)))) (newline) (unless (zero? (test-runner-fail-count runner)) @@ -260,7 +262,7 @@ object instead of the list element." (let ((name (assq-ref failure 'test-name)) (file (assq-ref failure 'source-file)) (line (assq-ref failure 'source-line)) - (test-type (chibi:match (assq-ref failure 'source-form) + (test-type (run64:match (assq-ref failure 'source-form) (('test-assert _ ...) 'assert) (('test-eq _ ...) 'eq) (('test-eqv _ ...) 'eqv) |
