From 93e6e92a15cdb40399920498ed7fdf5f2d755b0f Mon Sep 17 00:00:00 2001 From: Erik Sandberg Date: Fri, 19 May 2006 11:07:35 +0000 Subject: [PATCH] *** empty log message *** --- scm/ly-syntax-constructors.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scm/ly-syntax-constructors.scm diff --git a/scm/ly-syntax-constructors.scm b/scm/ly-syntax-constructors.scm new file mode 100644 index 0000000000..56322ff919 --- /dev/null +++ b/scm/ly-syntax-constructors.scm @@ -0,0 +1,25 @@ +;;;; 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-ly-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-ly-syntax-loc (args . body) + (primitive-eval `(define-ly-syntax ,(cons* (car args) 'location (cdr args)) + (let ((m ((lambda ,(cdr args) . ,body) . ,(cdr args)))) + (set! (ly:music-property m 'origin) location) + m)))) + +(define-ly-syntax-loc (sequential-music mlist) + (make-sequential-music mlist)) + +(define-ly-syntax-loc (simultaneous-music mlist) + (make-simultaneous-music mlist)) + +(define-ly-syntax-loc (repeat type num body alts) + (make-repeat type num body alts)) -- 2.39.5