[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-mcron] [PATCH 14/33] main: Make 'catch-mcron-error' macro hygienic.
From: |
Mathieu Lirzin |
Subject: |
[Bug-mcron] [PATCH 14/33] main: Make 'catch-mcron-error' macro hygienic. |
Date: |
Sun, 27 Sep 2015 23:00:25 +0200 |
* scm/mcron/main.scm (catch-mcron-error): Use 'define-syntax-rule'
instead of 'defmacro'.
---
scm/mcron/main.scm | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/scm/mcron/main.scm b/scm/mcron/main.scm
index 19631d1..e05e39e 100644
--- a/scm/mcron/main.scm
+++ b/scm/mcron/main.scm
@@ -64,19 +64,13 @@ When COMMAND is not specified this uses the first element
of (command-line)."
(when (and exit-code (not (eq? exit-code 0)))
(primitive-exit exit-code)))
-
-
-;; Code contributed by Sergey Poznyakoff. Execute body. If an 'mcron-error
-;; exception occurs, print its diagnostics and exit with its error code.
-
-(defmacro catch-mcron-error (. body)
- `(catch 'mcron-error
- (lambda ()
- ,@body)
- (lambda (key exit-code . msg)
- (apply mcron-error exit-code msg))))
-
-
+(define-syntax-rule (catch-mcron-error exp ...)
+ "Evaluate EXP .... if an 'mcron-error exception occurs, print its diagnostics
+and exit with its error code."
+ (catch 'mcron-error
+ (lambda () exp ...)
+ (lambda (key exit-code . msg)
+ (apply mcron-error exit-code msg))))
;; We will be doing a lot of testing of the command name, so it makes sense to
;; perform the string comparisons once and for all here.
- [Bug-mcron] [PATCH 06/33] main: Add show-help., (continued)
- [Bug-mcron] [PATCH 06/33] main: Add show-help., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 05/33] main: Add show-package-information., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 04/33] main: Add show-version., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 08/33] build: Improve maintainer-clean rule., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 07/33] Augment TODO., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 09/33] build: Generate 'ChangeLog' upon 'make dist'., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 10/33] build: Fix prerequisite of the man page target., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 11/33] main: Import the modules used in one time., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 12/33] main: Use 'when' and 'unless' special forms., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 14/33] main: Make 'catch-mcron-error' macro hygienic.,
Mathieu Lirzin <=
- [Bug-mcron] [PATCH 16/33] main: Add cron-file-descriptors., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 27/33] main: Improve 'process-user-file' definition., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 15/33] main: Add docstrings., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 26/33] mcron: Make functions 'static'., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 29/33] environment: Redefine 'modify-environment'., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 17/33] main: Add main., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 21/33] main: Remove obsolete debug option., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 22/33] redirect: Use module (ice-9 regex)., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 23/33] mcron: Add forward declarations., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 28/33] main: Remove unused 'regular-file?' procedure., Mathieu Lirzin, 2015/09/27