From d2e34b132a36978fc227ab9301c4407ea13212cb Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 16 Oct 2023 22:27:25 +0100 Subject: 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. --- ccwl/ccwl.scm | 12 ++++++------ 1 file 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) -- cgit v1.2.3