diff options
author | Arun Isaac | 2023-10-28 02:31:00 +0100 |
---|---|---|
committer | Arun Isaac | 2023-10-28 02:31:00 +0100 |
commit | 69ceaa5268810b099140aa14a68a36e7fc5a5106 (patch) | |
tree | 1ef61d4f09176203c55fcce6e59659dca1e90de7 | |
parent | 082835328cc98093282e33eaf20bcef3e97dbadf (diff) | |
download | ccwl-69ceaa5268810b099140aa14a68a36e7fc5a5106.tar.gz ccwl-69ceaa5268810b099140aa14a68a36e7fc5a5106.tar.lz ccwl-69ceaa5268810b099140aa14a68a36e7fc5a5106.zip |
ccwl: Restrict #:other parameter to YAML serializable trees.
Perhaps it fits in better with the spirit of ccwl to not evaluate
#:other parameters and instead allow only YAML serializable
trees. This saves users from quoting #:other parameters, of
course. But it also permits more thorough analysis and clearer error
messages. Besides, there is not much reason to allow general
expressions in #:other parameters. Such dynamism is not commonly
required in ccwl or CWL.
* ccwl/ccwl.scm (input, output, command): Restrict #:other parameter
to YAML serializable trees that are not evaluated.
-rw-r--r-- | ccwl/ccwl.scm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm index ca02cea..f3ff1f8 100644 --- a/ccwl/ccwl.scm +++ b/ccwl/ccwl.scm @@ -129,7 +129,7 @@ (() (condition (ccwl-violation input-spec) (formatted-message "Input has no identifier"))))))) - (apply (syntax-lambda** (id #:key (type #'File) label (default (make-unspecified-default)) (stage? #'#f) (other #''())) + (apply (syntax-lambda** (id #:key (type #'File) label (default (make-unspecified-default)) (stage? #'#f) (other #'())) (unless (memq (syntax->datum stage?) (list #t #f)) (raise-exception @@ -142,7 +142,7 @@ #,(if (unspecified-default? default) #'(make-unspecified-default) default) - #,position #,prefix #,stage? #,other))) + #,position #,prefix #,stage? '#,other))) #'(id args ...)))) (id (identifier? #'id) (input #'(id))) (_ (error "Invalid input:" (syntax->datum input-spec))))) @@ -190,8 +190,8 @@ (() (condition (ccwl-violation output-spec) (formatted-message "Output has no identifier"))))))) - (apply (syntax-lambda** (id #:key (type #'File) binding source (other #''())) - #`(make-output '#,id '#,type #,binding #,source #,other)) + (apply (syntax-lambda** (id #:key (type #'File) binding source (other #'())) + #`(make-output '#,id '#,type #,binding #,source '#,other)) #'(id args ...)))) (id (identifier? #'id) (output #'(id))) (_ (error "Invalid output:" (syntax->datum output-spec))))) @@ -362,7 +362,7 @@ identifiers defined in the commands." (condition (ccwl-violation extra) (formatted-message "Unexpected extra positional argument ~a in command definition" (syntax->datum extra)))))))) - (apply (syntax-lambda** (#:key stdin stderr stdout (requirements #''()) (other #''()) #:key* inputs outputs run) + (apply (syntax-lambda** (#:key stdin stderr stdout (requirements #''()) (other #'()) #:key* inputs outputs run) (when (null? run) (raise-exception (condition (ccwl-violation x) @@ -394,7 +394,7 @@ identifiers defined in the commands." (syntax->datum stdout)))) stdout) #,requirements - #,other)) + '#,other)) #'(args ...))))))) (define (cwl-workflow file) |