From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: KAction@gnu.org Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] Replace define-macro with syntax-rules Date: Sat, 28 Sep 2013 09:25:55 +0400 Message-ID: <1380345956-1720-1-git-send-email-KAction@gnu.org> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1380346136 22835 80.91.229.3 (28 Sep 2013 05:28:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Sep 2013 05:28:56 +0000 (UTC) Cc: wingo@pobox.com, ludo@gnu.org, Dmitry Bogatov To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Sep 28 07:29:00 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VPn5P-0006fL-Q4 for guile-devel@m.gmane.org; Sat, 28 Sep 2013 07:28:59 +0200 Original-Received: from localhost ([::1]:39720 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPn5P-0003sX-Cj for guile-devel@m.gmane.org; Sat, 28 Sep 2013 01:28:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPn5G-0003sR-Gn for guile-devel@gnu.org; Sat, 28 Sep 2013 01:28:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPn5B-0001SJ-5Q for guile-devel@gnu.org; Sat, 28 Sep 2013 01:28:50 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPn5A-0001SA-PJ for guile-devel@gnu.org; Sat, 28 Sep 2013 01:28:45 -0400 Original-Received: from [89.234.142.13] (port=36074 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1VPn58-0007K4-N2; Sat, 28 Sep 2013 01:28:43 -0400 X-Mailer: git-send-email 1.8.3.2 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16650 Archived-At: From: Dmitry Bogatov As I can see, definition with define-macro is hygienic and move to syntax-rules adds two lines of code, but define-syntax is considered preferable. WDYT? Signed-off-by: Dmitry Bogatov --- module/rnrs/bytevectors.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/rnrs/bytevectors.scm b/module/rnrs/bytevectors.scm index 9744359..856ad4a 100644 --- a/module/rnrs/bytevectors.scm +++ b/module/rnrs/bytevectors.scm @@ -75,9 +75,12 @@ (load-extension (string-append "libguile-" (effective-version)) "scm_init_bytevectors") -(define-macro (endianness sym) - (if (memq sym '(big little)) - `(quote ,sym) - (error "unsupported endianness" sym))) +(define-syntax endianness + (syntax-rules () + ((_ sym) + (let ((qsym (quote sym))) + (if (memq qsym '(big little)) + qsym + (error "unsupported endianness" qsym)))))) ;;; bytevector.scm ends here -- Recipients list generated via git-blame. Tell me, if you object.