From 0ff48dd263e3228b74b92122dc03fa539b3c6d98 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 30 Sep 2025 23:55:08 +0100 Subject: work/types: Rename to . array-type conflicts with a core Guile function. --- ravanan/command-line-tool.scm | 6 +++--- ravanan/reader.scm | 4 ++-- ravanan/work/command-line-tool.scm | 18 +++++++++--------- ravanan/work/types.scm | 16 ++++++++-------- ravanan/workflow.scm | 2 +- tests/work/command-line-tool.scm | 4 ++-- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ravanan/command-line-tool.scm b/ravanan/command-line-tool.scm index 356fb37..6e07099 100644 --- a/ravanan/command-line-tool.scm +++ b/ravanan/command-line-tool.scm @@ -224,7 +224,7 @@ G-expressions are inserted." (cond ;; Recurse over array types. ;; TODO: Implement record and enum types. - ((array-type? matched-type) + ((cwl-array-type? matched-type) (list (command-line-binding position prefix @@ -919,8 +919,8 @@ directory of the workflow." ((output-file) output-file))) ;; TODO: Recurse. - ((and (array-type? matched-type) - (memq (array-type-subtype matched-type) + ((and (cwl-array-type? matched-type) + (memq (cwl-array-type-subtype matched-type) (list 'File 'Directory))) (list->vector output-values)) ((eq? matched-type 'null) diff --git a/ravanan/reader.scm b/ravanan/reader.scm index d7670bb..2d10450 100644 --- a/ravanan/reader.scm +++ b/ravanan/reader.scm @@ -156,8 +156,8 @@ the @code{required} field when it is not specified." "Return @code{#t} if @var{type} is a @code{File}, an array of @code{File}s, an array of array of @code{File}s, etc. Else, return @code{#f}" (or (eq? type 'File) - (and (array-type? type) - (some-file-type? (array-type-subtype type))))) + (and (cwl-array-type? type) + (some-file-type? (cwl-array-type-subtype type))))) (define (normalize-formal-input input) "Normalize formal @var{input}." diff --git a/ravanan/work/command-line-tool.scm b/ravanan/work/command-line-tool.scm index 6378aa7..6891770 100644 --- a/ravanan/work/command-line-tool.scm +++ b/ravanan/work/command-line-tool.scm @@ -98,9 +98,9 @@ directory after THUNK returns." ((vector? obj) (match obj (#(head _ ...) - (array-type (object-type head))) + (cwl-array-type (object-type head))) (#() - (array-type 'Any)))) + (cwl-array-type 'Any)))) ;; File and Directory objects ((assoc-ref obj "class") => string->symbol) (else @@ -124,9 +124,9 @@ example, when @var{type} is a union type." ((eq? type 'double) (match-type obj 'float)) ;; Recursively match type of every element of array. - ((array-type? type) + ((cwl-array-type? type) (and (vector? obj) - (every (cut match-type <> (array-type-subtype type)) + (every (cut match-type <> (cwl-array-type-subtype type)) (vector->list obj)) type)) ;; Match any one of the subtypes of the union type. @@ -166,10 +166,10 @@ example, when @var{type} is a union type." 'directory) type)) (_ #f))) - ((array-type? type) + ((cwl-array-type? type) (and (every (lambda (m) (glob-match-type (list m) - (array-type-subtype type))) + (cwl-array-type-subtype type))) matches) type)) ((union-type? type) @@ -190,7 +190,7 @@ example, when @var{type} is a union type." ;; Array types ((string=? (assoc-ref type "type") "array") - (array-type (formal-parameter-type (assoc-ref type "items")))))) + (cwl-array-type (formal-parameter-type (assoc-ref type "items")))))) (define (run-command command stdin-file stdout-file success-codes) "Run @var{command} passing in @var{stdin-file} as the standard input @@ -320,7 +320,7 @@ the G-expressions are inserted." (maybe->list prefix) (list))) ((eq? type 'null) (list)) - ((array-type? type) + ((cwl-array-type? type) (match value ;; Empty arrays should be noops. (() (list)) @@ -390,7 +390,7 @@ be defined in the context in which the G-expressions are inserted." (cond ;; Recurse over array types. ;; TODO: Implement record and enum types. - ((array-type? matched-type) + ((cwl-array-type? matched-type) (list (command-line-binding position prefix diff --git a/ravanan/work/types.scm b/ravanan/work/types.scm index 8b17872..2defb6d 100644 --- a/ravanan/work/types.scm +++ b/ravanan/work/types.scm @@ -1,5 +1,5 @@ ;;; ravanan --- High-reproducibility CWL runner powered by Guix -;;; Copyright © 2024 Arun Isaac +;;; Copyright © 2024, 2025 Arun Isaac ;;; ;;; This file is part of ravanan. ;;; @@ -18,17 +18,17 @@ (define-module (ravanan work types) #:use-module (srfi srfi-9 gnu) - #:export (array-type - array-type? - array-type-subtype union-type union-type? union-type-subtypes)) + #:export (cwl-array-type + cwl-array-type? + cwl-array-type-subtype -(define-immutable-record-type - (array-type subtype) - array-type? - (subtype array-type-subtype)) +(define-immutable-record-type + (cwl-array-type subtype) + cwl-array-type? + (subtype cwl-array-type-subtype)) (define-immutable-record-type (-union-type subtypes) diff --git a/ravanan/workflow.scm b/ravanan/workflow.scm index 3f0ef27..27b1bc5 100644 --- a/ravanan/workflow.scm +++ b/ravanan/workflow.scm @@ -544,7 +544,7 @@ error out." ;; TODO: Implement record and enum types. (cond ;; Recurse over array types. - ((array-type? matched-type) + ((cwl-array-type? matched-type) (resolve input (make-vector (vector-length input) (assoc-ref type-tree "items")) diff --git a/tests/work/command-line-tool.scm b/tests/work/command-line-tool.scm index 3d11b53..3d63fbb 100644 --- a/tests/work/command-line-tool.scm +++ b/tests/work/command-line-tool.scm @@ -1,5 +1,5 @@ ;;; ravanan --- High-reproducibility CWL runner powered by Guix -;;; Copyright © 2024 Arun Isaac +;;; Copyright © 2024, 2025 Arun Isaac ;;; ;;; This file is part of ravanan. ;;; @@ -24,6 +24,6 @@ (test-equal "match null object to array type" #f - (match-type 'null (array-type 'File))) + (match-type 'null (cwl-array-type 'File))) (test-end "work.command-line-tool") -- cgit 1.4.1