diff options
-rw-r--r-- | ravanan/command-line-tool.scm | 1 | ||||
-rw-r--r-- | ravanan/utils.scm | 12 | ||||
-rw-r--r-- | ravanan/work/utils.scm | 10 | ||||
-rw-r--r-- | ravanan/workflow.scm | 1 |
4 files changed, 11 insertions, 13 deletions
diff --git a/ravanan/command-line-tool.scm b/ravanan/command-line-tool.scm index 14f9269..5676ce0 100644 --- a/ravanan/command-line-tool.scm +++ b/ravanan/command-line-tool.scm @@ -52,7 +52,6 @@ #:use-module (ravanan propnet) #:use-module (ravanan reader) #:use-module (ravanan slurm-api) - #:use-module (ravanan utils) #:use-module (ravanan vectors) #:use-module (ravanan work command-line-tool) #:use-module (ravanan work types) diff --git a/ravanan/utils.scm b/ravanan/utils.scm index fd84efa..d56378e 100644 --- a/ravanan/utils.scm +++ b/ravanan/utils.scm @@ -17,22 +17,12 @@ ;;; along with ravanan. If not, see <https://www.gnu.org/licenses/>. (define-module (ravanan utils) - #:use-module (rnrs base) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (ice-9 match) - #:export (assoc-ref* - json-ref + #:export (json-ref call-with-temporary-file)) -(define (assoc-ref* alist key) - "Return value mapped to @var{key} in @var{alist}. Raise an &assertion -if not found." - (match (assoc key alist) - ((_ . value) value) - (#f (assertion-violation (cons key alist) - "Missing key in association list")))) - (define (json-ref scm . keys) "Extract subtree of JSON @var{scm} that is addressed by @var{keys}." (match keys diff --git a/ravanan/work/utils.scm b/ravanan/work/utils.scm index d005447..51da34c 100644 --- a/ravanan/work/utils.scm +++ b/ravanan/work/utils.scm @@ -17,12 +17,14 @@ ;;; along with ravanan. If not, see <https://www.gnu.org/licenses/>. (define-module (ravanan work utils) + #:use-module ((rnrs base) #:select (assertion-violation)) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (ice-9 filesystem) #:use-module (ice-9 match) #:use-module (ice-9 popen) #:export (list->dotted-list + assoc-ref* assoc-set call-with-temporary-directory call-with-input-pipe)) @@ -35,6 +37,14 @@ pairs." (cons key value))) lst)) +(define (assoc-ref* alist key) + "Return value mapped to @var{key} in @var{alist}. Raise an &assertion +if not found." + (match (assoc key alist) + ((_ . value) value) + (#f (assertion-violation (cons key alist) + "Missing key in association list")))) + (define (assoc-set alist . pairs) "Functionally set @var{pairs} in @var{alist}. @var{alist} is not mutated." diff --git a/ravanan/workflow.scm b/ravanan/workflow.scm index 4d28716..9e9e868 100644 --- a/ravanan/workflow.scm +++ b/ravanan/workflow.scm @@ -25,7 +25,6 @@ #:use-module (ravanan monads) #:use-module (ravanan propnet) #:use-module (ravanan reader) - #:use-module (ravanan utils) #:use-module (ravanan vectors) #:use-module (ravanan work command-line-tool) #:use-module (ravanan work ui) |