diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ccwl.skb | 12 | ||||
-rw-r--r-- | doc/js-expression-iota.scm | 7 |
2 files changed, 17 insertions, 2 deletions
diff --git a/doc/ccwl.skb b/doc/ccwl.skb index cb78fd5..23bd798 100644 --- a/doc/ccwl.skb +++ b/doc/ccwl.skb @@ -1,5 +1,5 @@ ;;; ccwl --- Concise Common Workflow Language -;;; Copyright © 2021, 2023 Arun Isaac <arunisaac@systemreboot.net> +;;; Copyright © 2021, 2023–2024 Arun Isaac <arunisaac@systemreboot.net> ;;; ;;; This file is part of ccwl. ;;; @@ -389,7 +389,15 @@ the external CWL workflow.] keys forward to the output. This is what the ,(code [identity]) construct is for. An example follows.] (scheme-source "doc/identity-construct.scm") - (image :file "doc/identity-construct.png")))) + (image :file "doc/identity-construct.png"))) + (section :title [Javascript expressions via ExpressionTool] + :ident "javascript-expressions-via-expressiontool" + (p [ccwl supports CWL's ,(samp "ExpressionTool") using its +,(code "js-expression") construct. The ,(code "js-expression") +construct may be invoked from within workflows just like ,(code +"command") constructs can be. Here's a workflow that uses ,(code +"js-expression") to construct an array of numbers from 0 to n-1.] + (scheme-source "doc/js-expression-iota.scm")))) (chapter :title [Contributing] :ident "chapter-contributing" diff --git a/doc/js-expression-iota.scm b/doc/js-expression-iota.scm new file mode 100644 index 0000000..066e4ae --- /dev/null +++ b/doc/js-expression-iota.scm @@ -0,0 +1,7 @@ +(define iota + (js-expression #:inputs (n #:type int) + #:expression "$({\"sequence\": Array.from(Array(inputs.n).keys())})" + #:outputs (sequence #:type (array int)))) + +(workflow ((n #:type int)) + (iota #:n n)) |