aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorArun Isaac2023-11-23 17:49:45 +0000
committerArun Isaac2023-11-23 19:02:58 +0000
commit9f601fc3f131e82e1ee5791783d330bddde468d2 (patch)
tree1a5cfe580722168270634a5d51f0f41df1033962 /doc
parent00c911b1bd5aca3800e0263240968ad8f3fbefde (diff)
downloadccwl-9f601fc3f131e82e1ee5791783d330bddde468d2.tar.gz
ccwl-9f601fc3f131e82e1ee5791783d330bddde468d2.tar.lz
ccwl-9f601fc3f131e82e1ee5791783d330bddde468d2.zip
ccwl: Implement item separators for array inputs.
* ccwl/ccwl.scm (<input>)[separator]: New field. * ccwl/ccwl.scm (run-arg-position, run-args): Support array input specifiers. (run-arg-separator): New function. (command): Set separator on input objects. * ccwl/cwl.scm (input->cwl-scm): Serialize itemSeparator. * tests/ccwl.scm ("commands with non-string #:separator parameters must raise a &ccwl-violation condition"): New test. * doc/ccwl.skb (Cookbook)[Array input item separators]: New section. * doc/array-input-item-separators.scm: New file.
Diffstat (limited to 'doc')
-rw-r--r--doc/array-input-item-separators.scm2
-rw-r--r--doc/ccwl.skb11
2 files changed, 13 insertions, 0 deletions
diff --git a/doc/array-input-item-separators.scm b/doc/array-input-item-separators.scm
new file mode 100644
index 0000000..8cb5900
--- /dev/null
+++ b/doc/array-input-item-separators.scm
@@ -0,0 +1,2 @@
+(command #:inputs (messages #:type (array string))
+ #:run "echo" (array messages #:separator ","))
diff --git a/doc/ccwl.skb b/doc/ccwl.skb
index bcbb0e1..726b405 100644
--- a/doc/ccwl.skb
+++ b/doc/ccwl.skb
@@ -349,6 +349,17 @@ inputs to be staged. Here is a rather concocted example.]
(scheme-source "doc/array-types.scm"))
(p [Nested array types are also supported.]
(scheme-source "doc/nested-array-types.scm")))
+ (section :title [Array input item separators]
+ :ident "section-array-input-item-separators"
+ (p [Occasionally, it is required to serialize array type inputs
+by separating them with a specific item separator. This can be
+achieved by explicitly specifying a separator in the ,(code [#:run])
+argument of ,(code [command]). For example, to use comma as the item
+separator, you could do]
+ (scheme-source "doc/array-input-item-separators.scm")
+ [If ,(code "[foo, bar, aal, vel]") is passed in as ,(code
+[messages]), then the command invoked is ,(samp "echo
+foo,bar,aal,vel").]))
(section :title [Scatter/gather]
:ident "section-scatter-gather"
(p [ccwl supports CWL's dotproduct scatter/gather feature using