diff options
author | Ludovic Court`es | 2006-09-27 15:40:46 +0000 |
---|---|---|
committer | Ludovic Court`es | 2006-09-27 15:40:46 +0000 |
commit | 72fcb722a8ea8959edf160a676ca05df1665b64c (patch) | |
tree | 1c92cbd40551fdb77a1014ef91c8e4094a077f00 /src | |
parent | 0fe4342c25a3db2f077f0fe9f90abc4394e358c1 (diff) | |
download | skribilo-72fcb722a8ea8959edf160a676ca05df1665b64c.tar.gz skribilo-72fcb722a8ea8959edf160a676ca05df1665b64c.tar.lz skribilo-72fcb722a8ea8959edf160a676ca05df1665b64c.zip |
Tolerate engine instances in `lookup-engine-class'.
* src/guile/skribilo/engine.scm (copy-engine): Make a whole copy of the
engine customs.
(lookup-engine-class): Tolerate engine instances (while actually
expecting classes.
git-archimport-id: lcourtes@laas.fr--2005-libre/skribilo--engine-classes--1.2--patch-3
Diffstat (limited to 'src')
-rw-r--r-- | src/guile/skribilo/engine.scm | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/guile/skribilo/engine.scm b/src/guile/skribilo/engine.scm index 163fe06..b1e4235 100644 --- a/src/guile/skribilo/engine.scm +++ b/src/guile/skribilo/engine.scm @@ -186,6 +186,7 @@ engine))) (define (make-engine engine-class) + ;; Instantiate ENGINE-CLASS. (make engine-class)) @@ -193,7 +194,6 @@ (define (engine-ident obj) (engine-class-ident (engine-class obj))) (define (engine-format obj) (engine-class-format (engine-class obj))) -;;(define (engine-customs obj) (engine-class-customs (engine-class obj))) (define (engine-filter obj) (engine-class-filter (engine-class obj))) (define (engine-symbol-table obj) (engine-class-symbol-table (engine-class obj))) @@ -275,8 +275,7 @@ ;;; (define (copy-engine e) (let ((new (shallow-clone e))) - (slot-set! new 'class (engine-class e)) - (slot-set! new 'customs (list-copy (slot-ref e 'customs))) + (slot-set! new 'customs (map list-copy (slot-ref e 'customs))) new)) (define* (copy-engine-class ident e :key (version 'unspecified) @@ -365,9 +364,15 @@ otherwise the requested engine is returned." (let* ((engine (symbol-append id '-engine)) (m (resolve-module (engine-id->module-name id)))) (if (module-bound? m engine) - (let ((e (module-ref m engine))) - (if e (consume-load-hook! id)) - e) + (let* ((e (module-ref m engine)) + ;; We have to have this thin compatibility layer here. + (c (cond ((engine-class? e) e) + ((engine? e) (engine-class e)) + (else + (skribe-error 'lookup-engine-class + "not an engine class" e))))) + (if c (consume-load-hook! id)) + c) (error "no such engine" id))))) |