Hi Patrick,
On 10/11/10 06:01, [email protected] wrote:
> Hi Ian,
>
> LGTM.
>
> Before sending me the git patch, I would recommend changing the subject
> from "Remove (define define-ly-syntax define-public)" to something more
> accurate that reflects what this patch fixes.
>
> Thanks for your work on this!
>
> Regards,
> Patrick
>
> http://codereview.appspot.com/2313044/
Patch with amended title attached.

Ian
>From 9d452ceb7b44e5f2f1b3880384216763a7558933 Mon Sep 17 00:00:00 2001
From: Ian Hulin <[email protected]>
Date: Wed, 10 Nov 2010 20:08:36 +0000
Subject: [PATCH] T1249: Prevent compilation error in ly-syntax-constructors with Guile V2.0.

Replace (define) with (defmacro) for define-ly-syntax
Remove primitive-eval wrapper in define-ly-syntax-loc and
define-ly-syntax-simple.
---
 scm/ly-syntax-constructors.scm |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/scm/ly-syntax-constructors.scm b/scm/ly-syntax-constructors.scm
index 82aee84..92276e7 100644
--- a/scm/ly-syntax-constructors.scm
+++ b/scm/ly-syntax-constructors.scm
@@ -17,7 +17,8 @@
 
 ;; TODO: use separate module for syntax
 ;; constructors. Also create wrapper around the constructor?
-(define define-ly-syntax define-public)
+(defmacro define-ly-syntax (args . body)
+  `(define-public ,args ,(cons 'begin body)))
 
 ;; A ly-syntax constructor takes two extra parameters, parser and
 ;; location. These are mainly used for reporting errors and
@@ -25,22 +26,21 @@
 ;; location arg to set the origin of the returned music object; this
 ;; behaviour is usually desired
 (defmacro define-ly-syntax-loc (args . body)
-  (primitive-eval `(define-ly-syntax ,args
-		     (let ((m ,(cons 'begin body)))
-		       (set! (ly:music-property m 'origin) ,(third args))
-		       m))))
-
+  `(define-public ,args
+     (let ((m ,(cons 'begin body)))
+       (set! (ly:music-property m 'origin) ,(third args))
+       m)))
 ;; Like define-ly-syntax-loc, but adds parser and location
 ;; parameters. Useful for simple constructors that don't need to
 ;; report errors.
 (defmacro define-ly-syntax-simple (args . body)
-  (primitive-eval `(define-ly-syntax ,(cons* (car args) 
-					     'parser
-					     'location 
-					     (cdr args))
-		     (let ((m ,(cons 'begin body)))
-		       (set! (ly:music-property m 'origin) location)
-		       m))))
+  `(define-public ,(cons* (car args)
+			  'parser
+			  'location
+			  (cdr args))
+     (let ((m ,(cons 'begin body)))
+       (set! (ly:music-property m 'origin) location)
+       m)))
 
 ;; Music function: Apply function and check return value.
 (define-ly-syntax-loc (music-function parser loc fun args)
-- 
1.7.0.4

_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to