From 9f601fc3f131e82e1ee5791783d330bddde468d2 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 23 Nov 2023 17:49:45 +0000 Subject: ccwl: Implement item separators for array inputs. * ccwl/ccwl.scm ()[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. --- doc/array-input-item-separators.scm | 2 ++ doc/ccwl.skb | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 doc/array-input-item-separators.scm (limited to 'doc') 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 -- cgit v1.2.3