diff options
author | Arun Isaac | 2021-06-28 19:39:21 +0530 |
---|---|---|
committer | Arun Isaac | 2021-06-29 00:08:14 +0530 |
commit | 5ba0ef3dc28c17a8873d5588b4ce8552a88abe8b (patch) | |
tree | a6cf0c5d831583c990f15c0549dac4a08229e517 | |
parent | 9e374f38ab9bc508cce5c0644265cff381edc2a4 (diff) | |
download | ccwl-5ba0ef3dc28c17a8873d5588b4ce8552a88abe8b.tar.gz ccwl-5ba0ef3dc28c17a8873d5588b4ce8552a88abe8b.tar.lz ccwl-5ba0ef3dc28c17a8873d5588b4ce8552a88abe8b.zip |
ccwl: Return #f if alist is empty after filtering.
This way, filter-alist composes better with other invocations of
filter-alist.
* ccwl/ccwl.scm (filter-alist): Return #f if alist is empty after
filtering.
(command->cwl): Remove FIXME note about the inputBinding dictionary
being empty.
-rw-r--r-- | ccwl/ccwl.scm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm index 9da805e..9c24a1b 100644 --- a/ccwl/ccwl.scm +++ b/ccwl/ccwl.scm @@ -72,11 +72,15 @@ (make-output id type binding source other)) (define (filter-alist alist) - "Filter ALIST removing entries with #f as the value." - (filter (match-lambda - ((_ . #f) #f) - (_ #t)) - alist)) + "Filter ALIST removing entries with #f as the value. If the +resulting association list is empty, return #f. Else, return that +association list." + (match (filter (match-lambda + ((_ . #f) #f) + (_ #t)) + alist) + (() #f) + (result result))) (define-immutable-record-type <step> (make-step id run in out) @@ -245,7 +249,6 @@ (label . ,(input-label input)) (default . ,(and (not (unspecified-default? (input-default input))) (input-default input))) - ;; FIXME: inputBinding can be an empty dictionary. (inputBinding . ,(filter-alist `((position . ,(input-position input)) (prefix . ,(input-prefix input))))))) |