Erik Sandberg schreef:
Hi,
I have yet another suggestion for how \relative can be soft-coded in a generic
way. It's inspired by criticism of earlier attempts. It's similar, but not
identical, to a previous suggestion.
Macros is that they operate on syntax, not on music. And the parser spits out
music directly. So what I suggest, is to let the parser spit out yet another
intermediate format, which is a Scheme expression that more or less
corresponds to the the parse tree. So, for example,
\repeat volta 2 { c8 d e \foo }
would parse into a Scheme expression
(repeat 'volta 2 (sequential <c8> <d8> <e8> foo))
where <c8> etc. are Music objects (or possibly expressions that evaluate to
Music objects).
I think it's a nice cleanup to go through such a layer of scheme,
although I'd recommend to use Nicolas' make-music functions instead.
I'm not yet convinced that this will be useful. The arity of each
syntical expression (\relative, \repeat), will have to be specified in
advance anyway, which limits flexibility. Otherwise the parser can't
parse it, which means that the options of overriding each part of the
expression is limited.
- For those who want to do programming using lily syntax, it will be easy to
export Scheme functions and macros to the lily parser at runtime. This will
probably reduce the number of feature requests that come to our mailing
lists.
I doubt that. The problem with the programming extension: is 2 fold
- the docs aren't good enough
- people don't want to learn 'complicated' things
the feature requests are extensions that just look easy to the person
requesting it, but always are always horrible syntax kludges. I think
we'd get more of those, as the role of the 'scary' Scheme interpreter is
further extended with your proposal.
--
Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen
LilyPond Software Design
-- Code for Music Notation
http://www.lilypond-design.com
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel