diff options
author | Ludovic Courtès | 2020-08-06 18:49:31 +0200 |
---|---|---|
committer | Ludovic Courtès | 2020-08-06 18:49:31 +0200 |
commit | 47fd87d615102e20ec9b6ea648401caf91828711 (patch) | |
tree | be73967a60521dc2f88414a8c8289d7e2f7c2d16 /src/guile/skribilo/utils/syntax.scm | |
parent | 34c340fc7b3fa5c7218b4e42a37e8267c7258245 (diff) | |
download | skribilo-47fd87d615102e20ec9b6ea648401caf91828711.tar.gz skribilo-47fd87d615102e20ec9b6ea648401caf91828711.tar.lz skribilo-47fd87d615102e20ec9b6ea648401caf91828711.zip |
Remove 'cond-expand' clauses for Guile 1.8.
This is a followup to d183aa487d99baea3746f79759c17cf36c55dfbf.
* src/guile/skribilo/debug.scm (with-debug): Remove 'cond-expand' and
keep only 'guile-2' version.
* src/guile/skribilo/engine/html.scm (&html-generic-document)[set-output-encoding]:
Likewise.
* src/guile/skribilo/engine/info.scm (document): Likewise.
* src/guile/skribilo/engine/latex.scm (document): Likewise.
* src/guile/skribilo/engine/lout.scm (document): Likewise.
* src/guile/skribilo/evaluator.scm (%evaluate): Likewise.
* src/guile/skribilo/location.scm <top level>: Likewise.
* src/guile/skribilo/module.scm (maybe-set-module-name!): Likewise.
* src/guile/skribilo/package/base.scm <top level>: Likewise.
* src/guile/skribilo/utils/syntax.scm (unless, when): Remove.
(set-correct-file-encoding!, default-to-utf-8): Keep only 'guile-2' variant.
* tests/location.test <top level>: Likewise.
* tests/readers/rss-2.test <top level>: Likewise.
Diffstat (limited to 'src/guile/skribilo/utils/syntax.scm')
-rw-r--r-- | src/guile/skribilo/utils/syntax.scm | 58 |
1 files changed, 15 insertions, 43 deletions
diff --git a/src/guile/skribilo/utils/syntax.scm b/src/guile/skribilo/utils/syntax.scm index 5c606fc..e10fd18 100644 --- a/src/guile/skribilo/utils/syntax.scm +++ b/src/guile/skribilo/utils/syntax.scm @@ -71,49 +71,21 @@ (lambda () ,expr1) (lambda () ,expr2))) -(cond-expand - ((not guile-2) - ;; In Guile 2.x these macros are defined in the core. - (begin - (define-macro (unless condition . exprs) - `(if (not ,condition) - ,(if (null? (cdr exprs)) - (car exprs) - `(begin ,@exprs)))) - - (define-macro (when condition . exprs) - `(if ,condition - ,(if (null? (cdr exprs)) - (car exprs) - `(begin ,@exprs)))) - - (export when unless))) - (else (begin))) - -(cond-expand - (guile-2 - (define-syntax set-correct-file-encoding! - (syntax-rules () - ((_) - (set-correct-file-encoding! (current-input-port))) - ((_ port) - ;; Use the encoding specified by the `coding:' comment. - (let ((e (false-if-exception (file-encoding port)))) - (and (string? e) - (set-port-encoding! port e)))))) - - (define-syntax default-to-utf-8 - (syntax-rules () - ((_ body ...) - (with-fluids ((%default-port-encoding "UTF-8")) - body ...))))) - - (else - (define-macro (set-correct-file-encoding! . p) - #f) - - (define-macro (default-to-utf-8 . body) - `(begin ,@body)))) +(define-syntax set-correct-file-encoding! + (syntax-rules () + ((_) + (set-correct-file-encoding! (current-input-port))) + ((_ port) + ;; Use the encoding specified by the `coding:' comment. + (let ((e (false-if-exception (file-encoding port)))) + (and (string? e) + (set-port-encoding! port e)))))) + +(define-syntax default-to-utf-8 + (syntax-rules () + ((_ body ...) + (with-fluids ((%default-port-encoding "UTF-8")) + body ...)))) ;;; |