]> git.donarmstrong.com Git - lilypond.git/commitdiff
T1249: Prevent compilation error in ly-syntax-constructors with Guile V2.0.
authorIan Hulin <ian@hulin.org.uk>
Wed, 10 Nov 2010 20:08:36 +0000 (20:08 +0000)
committerPatrick McCarty <pnorcks@gmail.com>
Fri, 12 Nov 2010 04:28:54 +0000 (20:28 -0800)
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

index 82aee84d0a7190b1a9c0cdcec230f933d00d483b..92276e745f1ca9fbc31e367b6d02fa7633e82d2e 100644 (file)
@@ -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
 ;; 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)