diff options
author | Arun Isaac | 2023-10-16 22:27:25 +0100 |
---|---|---|
committer | Arun Isaac | 2023-10-16 22:41:19 +0100 |
commit | d2e34b132a36978fc227ab9301c4407ea13212cb (patch) | |
tree | 32dd59154487d05d554a3bbfb293da0aa8971b67 | |
parent | bc6bc78ac3079822dcd5bc51e36983a7470fdc04 (diff) | |
download | ccwl-d2e34b132a36978fc227ab9301c4407ea13212cb.tar.gz ccwl-d2e34b132a36978fc227ab9301c4407ea13212cb.tar.lz ccwl-d2e34b132a36978fc227ab9301c4407ea13212cb.zip |
ccwl: Support arbitrary expressions in #:other arguments.
Support arbitrary expressions, that are actually evaluated, in #:other arguments. This means, among other things, that users will have to quote them correctly. While this complicates matters for novice users who may not be familiar with scheme, it is the most general and most flexible solution. In this particular case, we value flexibility over ease of use since #:other is an escape hatch and if users have to use it, ease of use has already been lost. * ccwl/ccwl.scm (input, output, command): Make #:other an actually evaluated unary argument.
-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 f9243aa..f193ea9 100644 --- a/ccwl/ccwl.scm +++ b/ccwl/ccwl.scm @@ -126,14 +126,14 @@ (() (condition (ccwl-violation input-spec) (formatted-message "Input has no identifier"))))))) - (apply (syntax-lambda** (id #:key (type #'File) label (default (make-unspecified-default)) #:key* other) + (apply (syntax-lambda** (id #:key (type #'File) label (default (make-unspecified-default)) (other #''())) (let ((position #f) (prefix #f)) #`(make-input '#,id '#,type #,label #,(if (unspecified-default? default) #'(make-unspecified-default) default) - #,position #,prefix '#,other))) + #,position #,prefix #,other))) #'(id args ...)))) (id (identifier? #'id) (input #'(id))) (_ (error "Invalid input:" (syntax->datum input-spec))))) @@ -181,8 +181,8 @@ (() (condition (ccwl-violation output-spec) (formatted-message "Output has no identifier"))))))) - (apply (syntax-lambda** (id #:key (type #'File) binding source #:key* 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))))) @@ -352,7 +352,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 #:key* inputs outputs run other) + (apply (syntax-lambda** (#:key stdin stderr stdout (other #''()) #:key* inputs outputs run) (when (null? run) (raise-exception (condition (ccwl-violation x) @@ -381,7 +381,7 @@ identifiers defined in the commands." (condition (ccwl-violation stdout) (formatted-message "#:stdout parameter must be a string"))) stdout) - (list #,@other))) + #,other)) #'(args ...))))))) (define (cwl-workflow file) |