From 20d06da971f9577aed3077489b3ecbd1a4082ddc Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 26 Apr 2021 08:51:18 +0200 Subject: high: Add memoized implementation procedure. * drmaa/v1/high.scm (implementation): New procedure. --- drmaa/v1/high.scm | 9 +++++++++ 1 file changed, 9 insertions(+) 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 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 )) (define klass (class-of instance)) (define t (low:allocate-job-template!)) -- cgit v1.2.3