From 61fe28bd785f04fb4df33f43feef59406a9f0880 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 16 Jul 2010 16:12:25 +0200 Subject: Fix `engine-loaded?' for Guile 2.0. * src/guile/skribilo/engine.scm (engine-loaded?): Use `cond-expand' and add a method that works with 2.0. --- src/guile/skribilo/engine.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/guile/skribilo/engine.scm b/src/guile/skribilo/engine.scm index 691b801..dd0bfb5 100644 --- a/src/guile/skribilo/engine.scm +++ b/src/guile/skribilo/engine.scm @@ -277,8 +277,14 @@ (define (engine-loaded? id) "Check whether engine @var{id} is already loaded." ;; Trick taken from `resolve-module' in `boot-9.scm'. - (nested-ref the-root-module - `(%app modules ,@(engine-id->module-name id)))) + (cond-expand (guile-2 + (nested-ref-module (resolve-module '() #f) + (engine-id->module-name id))) + (else + ;; This method works for 1.8 but is deprecated in 1.9/2.0 and + ;; doesn't work with 1.9.11 anyway. + (nested-ref the-root-module + `(%app modules ,@(engine-id->module-name id)))))) ;; A mapping of engine names to hooks. (define %engine-load-hook (make-hash-table)) -- cgit v1.2.3