[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, cky-hygienic-macros, updated. v2.0.9-1

From: Chris K. Jester-Young
Subject: [Guile-commits] GNU Guile branch, cky-hygienic-macros, updated. v2.0.9-100-g0e07c94
Date: Mon, 28 Oct 2013 14:21:31 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

The branch, cky-hygienic-macros has been updated
       via  0e07c94ef11c772b8dec7111aa8cb14945874767 (commit)
      from  5b491e4f2829d3644c1194c1dcccd320dd7c3ef6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0e07c94ef11c772b8dec7111aa8cb14945874767
Author: Chris K. Jester-Young <address@hidden>
Date:   Mon Oct 28 10:17:03 2013 -0400

    Convert (ice-9 session) to use hygienic macros.
    * module/ice-9/session.scm (help): Convert to syntax-rules. Also move
      most of the body into help-internal; help messages should not be
      displayed at macro-expansion time.
      (help-internal): New procedure.


Summary of changes:
 module/ice-9/session.scm |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/module/ice-9/session.scm b/module/ice-9/session.scm
index ce1bcac..0398707 100644
--- a/module/ice-9/session.scm
+++ b/module/ice-9/session.scm
@@ -78,19 +78,19 @@ handlers, potentially falling back on the normal behavior 
for `help'."
 ;;; Documentation
-(define-macro (help . exp)
-  "(help [NAME])
+(define-syntax help
+  (syntax-rules ()
+    "(help [NAME])
 Prints useful information.  Try `(help)'."
-  (cond ((not (= (length exp) 1))
-         (help-usage)
-         '(begin))
-        ((not (provided? 'regex))
+    ((_ name) (help-internal 'name))
+    ((_ ...) (help-usage))))
+(define (help-internal name)
+  (cond ((not (provided? 'regex))
          (display "`help' depends on the `regex' feature.
-You don't seem to have regular expressions installed.\n")
-         '(begin))
+You don't seem to have regular expressions installed.\n"))
-         (let ((name (car exp))
-               (not-found (lambda (type x)
+         (let ((not-found (lambda (type x)
                             (simple-format #t "No ~A found for ~A\n"
                                            type x))))
@@ -143,8 +143,7 @@ You don't seem to have regular expressions installed.\n")
             ;; unrecognized
-             (help-usage)))
-           '(begin)))))
+             (help-usage)))))))
 (define (module-filename name)          ; fixme: better way? / done elsewhere?
   (let* ((name (map symbol->string name))

GNU Guile

reply via email to

[Prev in Thread] Current Thread [Next in Thread]