diff options
-rw-r--r-- | drmaa/v1/low.scm | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/drmaa/v1/low.scm b/drmaa/v1/low.scm index 0d71e32..ca2b8d7 100644 --- a/drmaa/v1/low.scm +++ b/drmaa/v1/low.scm @@ -262,23 +262,22 @@ not be affected by this." #true error-message))) -(define set-attribute! +(define (set-attribute! template name value) (let ((valid (get-attribute-names))) - (lambda (template name value) - (unless (member name valid) - (raise (condition - (&formatted-message - (format "This DRMAA implementation does not support the attribute `~a'.~%") - (arguments (list name)))))) - (let ((error-message - (make-char* (bytevector->pointer - (make-bytevector (DRMAA 'ERROR_STRING_BUFFER)))))) - (return (drmaa_set_attribute template - (string->pointer name) value - error-message - (DRMAA 'ERROR_STRING_BUFFER)) - #true - error-message))))) + (unless (member name valid) + (raise (condition + (&formatted-message + (format "This DRMAA implementation does not support the attribute `~a'.~%") + (arguments (list name)))))) + (let ((error-message + (make-char* (bytevector->pointer + (make-bytevector (DRMAA 'ERROR_STRING_BUFFER)))))) + (return (drmaa_set_attribute template + (string->pointer name) value + error-message + (DRMAA 'ERROR_STRING_BUFFER)) + #true + error-message)))) (define (get-attribute template name) (let ((error-message @@ -296,25 +295,24 @@ not be affected by this." (char*->string value) error-message))) -(define set-vector-attribute! +(define (set-vector-attribute! template name . values) (let ((valid (get-vector-attribute-names))) - (lambda (template name . values) - (unless (member name valid) - (raise (condition - (&formatted-message - (format "This DRMAA implementation does not support the vector attribute `~a'.~%") - (arguments (list name)))))) - (let ((error-message - (make-char* (bytevector->pointer - (make-bytevector (DRMAA 'ERROR_STRING_BUFFER))))) - (array (make-cstr-array values))) - (return (drmaa_set_vector_attribute template - name - (bytevector->pointer array) - error-message - (DRMAA 'ERROR_STRING_BUFFER)) - #true - error-message))))) + (unless (member name valid) + (raise (condition + (&formatted-message + (format "This DRMAA implementation does not support the vector attribute `~a'.~%") + (arguments (list name)))))) + (let ((error-message + (make-char* (bytevector->pointer + (make-bytevector (DRMAA 'ERROR_STRING_BUFFER))))) + (array (make-cstr-array values))) + (return (drmaa_set_vector_attribute template + name + (bytevector->pointer array) + error-message + (DRMAA 'ERROR_STRING_BUFFER)) + #true + error-message)))) (define (get-vector-attribute template name) (let ((error-message |