summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/guile/skribilo.scm16
-rw-r--r--src/guile/skribilo/lib.scm6
-rw-r--r--src/guile/skribilo/skribe/api.scm18
3 files changed, 15 insertions, 25 deletions
diff --git a/src/guile/skribilo.scm b/src/guile/skribilo.scm
index a560b46..e131ff3 100644
--- a/src/guile/skribilo.scm
+++ b/src/guile/skribilo.scm
@@ -39,22 +39,6 @@ exec ${GUILE-guile} --debug -l $0 -c "(apply $main (cdr (command-line)))" "$@"
;;;;
;;;; Code:
-(let ((gensym-orig gensym))
- ;; In Skribe, `gensym' expects a symbol as its (optional) argument, while
- ;; Guile's `gensym' expect a string. XXX
- (set! gensym
- (lambda args
- (if (null? args)
- (gensym-orig)
- (let ((the-arg (car args)))
- (cond ((symbol? the-arg)
- (gensym-orig (symbol->string the-arg)))
- ((string? the-arg)
- (gensym-orig the-arg))
- (else
- (skribe-error 'gensym "Invalid argument type"
- the-arg))))))))
-
(define-module (skribilo)
diff --git a/src/guile/skribilo/lib.scm b/src/guile/skribilo/lib.scm
index 7a0c306..fc00896 100644
--- a/src/guile/skribilo/lib.scm
+++ b/src/guile/skribilo/lib.scm
@@ -111,7 +111,8 @@
`(define-markup (,markup :rest opts :key ident class loc)
(new markup
(markup ',markup)
- (ident (or ident (symbol->string (gensym ',markup))))
+ (ident (or ident (symbol->string
+ (gensym ',(symbol->string markup)))))
(loc loc)
(class class)
(required-options '())
@@ -126,7 +127,8 @@
`(define-markup (,markup :rest opts :key ident class loc)
(new container
(markup ',markup)
- (ident (or ident (symbol->string (gensym ',markup))))
+ (ident (or ident (symbol->string
+ (gensym ',(symbol->string markup)))))
(loc loc)
(class class)
(required-options '())
diff --git a/src/guile/skribilo/skribe/api.scm b/src/guile/skribilo/skribe/api.scm
index a300606..9a6369d 100644
--- a/src/guile/skribilo/skribe/api.scm
+++ b/src/guile/skribilo/skribe/api.scm
@@ -19,7 +19,8 @@
;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;; USA.
-(define-skribe-module (skribilo skribe api))
+(define-skribe-module (skribilo skribe api)
+ :replace (gensym))
;;; Author: Manuel Serrano
;;; Commentary:
@@ -32,13 +33,16 @@
;;; The contents of the file below are unchanged compared to Skribe 1.2d's
;;; `api.scm' file found in the `common' directory.
-(let ((gensym-orig gensym))
+(define %gensym-orig (module-ref the-root-module 'gensym))
+
+(define gensym
;; In Skribe, `gensym' accepts a symbol. Guile's `gensym' accepts only
- ;; strings.
- (set! gensym
- (lambda (obj)
- (gensym-orig (cond ((symbol? obj) (symbol->string obj))
- (else obj))))))
+ ;; strings (or no argument).
+ (lambda obj
+ (apply %gensym-orig
+ (cond ((null? obj) '())
+ ((symbol? (car obj)) (list (symbol->string (car obj))))
+ (else (skribe-error 'gensym "invalid argument" obj))))))
;*---------------------------------------------------------------------*/