summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-04-26 08:51:18 +0200
committerRicardo Wurmus <rekado@elephly.net>2021-04-26 08:51:18 +0200
commit20d06da971f9577aed3077489b3ecbd1a4082ddc (patch)
treed86fe0be30263ff8681e9408fa8cff31fdd20874
parentd25d0b48a10accd457c59c074ac9914bdbb56c71 (diff)
high: Add memoized implementation procedure.
* drmaa/v1/high.scm (implementation): New procedure.
-rw-r--r--drmaa/v1/high.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/drmaa/v1/high.scm b/drmaa/v1/high.scm
index 8751da7..e0f4fbb 100644
--- a/drmaa/v1/high.scm
+++ b/drmaa/v1/high.scm
@@ -279,6 +279,15 @@
(define (job-template . args)
(apply make <job-template> args))
+(define implementation
+ (let ((result #false))
+ (lambda ()
+ "Return the DRMAA implementation. This is a memoized procedure."
+ (or result
+ (begin
+ (set! result (low:get-drmaa-implementation))
+ result)))))
+
(define-method (lower-job-template (instance <job-template>))
(define klass (class-of instance))
(define t (low:allocate-job-template!))