about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2025-09-30 23:55:08 +0100
committerArun Isaac2025-11-16 22:43:00 +0000
commit0ff48dd263e3228b74b92122dc03fa539b3c6d98 (patch)
treeb2e4f5b02be0479671da4b737c8a7f1282e4303d
parent94e9d9f9a353a74b802ddb395dbe347350dcbb54 (diff)
downloadravanan-0ff48dd263e3228b74b92122dc03fa539b3c6d98.tar.gz
ravanan-0ff48dd263e3228b74b92122dc03fa539b3c6d98.tar.lz
ravanan-0ff48dd263e3228b74b92122dc03fa539b3c6d98.zip
work/types: Rename <array-type> to <cwl-array-type>.
array-type conflicts with a core Guile function.
-rw-r--r--ravanan/command-line-tool.scm6
-rw-r--r--ravanan/reader.scm4
-rw-r--r--ravanan/work/command-line-tool.scm18
-rw-r--r--ravanan/work/types.scm16
-rw-r--r--ravanan/workflow.scm2
-rw-r--r--tests/work/command-line-tool.scm4
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 <arunisaac@systemreboot.net>
+;;; Copyright © 2024, 2025 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; 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>
-  (array-type subtype)
-  array-type?
-  (subtype array-type-subtype))
+(define-immutable-record-type <cwl-array-type>
+  (cwl-array-type subtype)
+  cwl-array-type?
+  (subtype cwl-array-type-subtype))
 
 (define-immutable-record-type <union-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 <arunisaac@systemreboot.net>
+;;; Copyright © 2024, 2025 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; 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")