;;;; define-syntax.scm -- Defines functions for syntax expressions ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; ;;;; (c) 2006 Erik Sandberg ;; TODO: use separate module for parser. (define define-syntax define-public) ;; This shorthand adds a location parameter, and uses it to set the ;; origin. It can be used for most music functions. (defmacro define-syntax-loc (args . body) (primitive-eval `(define-syntax ,(cons* (car args) 'location (cdr args)) (let ((m ((lambda ,(cdr args) . ,body) . ,(cdr args)))) (set! (ly:music-property m 'origin) location) m)))) (define-syntax-loc (sequential-music mlist) (make-sequential-music mlist)) (define-syntax-loc (simultaneous-music mlist) (make-simultaneous-music mlist)) (define-syntax-loc (repeat type num body alts) (make-repeat type num body alts))