diff options
-rw-r--r-- | ccwl/ccwl.scm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm index e73b9e6..0eed492 100644 --- a/ccwl/ccwl.scm +++ b/ccwl/ccwl.scm @@ -127,6 +127,16 @@ (in step-in set-step-in) (out step-out set-step-out)) +(define (field-appender getter setter) + (lambda (object element) + (setter object (cons element (getter object))))) + +(define append-step-in + (field-appender step-in set-step-in)) + +(define append-step-out + (field-appender step-out set-step-out)) + (define-immutable-record-type <command> (make-command inputs outputs args stdin other) command? @@ -136,6 +146,12 @@ (stdin command-stdin set-command-stdin) (other command-other)) +(define append-command-inputs + (field-appender command-inputs set-command-inputs)) + +(define append-command-outputs + (field-appender command-outputs set-command-outputs)) + (define* (command id arguments #:key (additional-inputs '()) (outputs '()) (other '())) (make-step id (make-command (append (filter input? arguments) |