1 ;;;; define-syntax.scm -- Defines functions for syntax expressions
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 2006 Erik Sandberg <mandolaerik@gmail.com>
7 ;; TODO: use separate module for parser.
8 (define define-ly-syntax define-public)
10 ;; This shorthand adds a location parameter, and uses it to set the
11 ;; origin. It can be used for most music functions.
12 (defmacro define-ly-syntax-loc (args . body)
13 (primitive-eval `(define-ly-syntax ,(cons* (car args) 'location (cdr args))
14 (let ((m ((lambda ,(cdr args) . ,body) . ,(cdr args))))
15 (set! (ly:music-property m 'origin) location)
18 (define-ly-syntax-loc (sequential-music mlist)
19 (make-sequential-music mlist))
21 (define-ly-syntax-loc (simultaneous-music mlist)
22 (make-simultaneous-music mlist))
24 (define-ly-syntax-loc (repeat type num body alts)
25 (make-repeat type num body alts))