aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLudovic Courtès2010-07-16 16:12:25 +0200
committerLudovic Courtès2010-07-16 16:12:25 +0200
commit61fe28bd785f04fb4df33f43feef59406a9f0880 (patch)
tree3ad646fb9e15eae0333a80003cb55001c911aad6 /src
parent255c13f78a11c79b860ca6681e187879ac5583bf (diff)
downloadskribilo-61fe28bd785f04fb4df33f43feef59406a9f0880.tar.gz
skribilo-61fe28bd785f04fb4df33f43feef59406a9f0880.tar.lz
skribilo-61fe28bd785f04fb4df33f43feef59406a9f0880.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/guile/skribilo/engine.scm10
1 files 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))