Macro pre-processors should generate source code, and stream it in, period. Macros have nothing to do with compilation or scheme or c++ or anything else in lilypond. They should just provide some logical constructs like IF/THEN/ELSE, LOOPING, and CASE, and other functions like concatenation/replacement of strings. Allowing one to stream unvalidated strings as source code emerging from a macro, note the macro should not care if the outputted source is valid or not, the macro should not even know it's outputting source code for lilypond, for that matter. Compile time will tell you your errors and if your macros is generating garbage or not.
I currently have a 10,000 line LP file that I would LOVE to shorten up by having a flexible macro-pre-processor to generate the source code for me instead of me copy/pasting every time I want to add something. (this particular file is a guitar chords library of fret markups and growing). It has about 5 or 6 lines of source per fret diagram, I know I can write a macro to generate the source code one line per chord in all enharmonic root spellings. Currently each chord with all roots across 20 frets means about 150 source code lines per chord, that could be one source code line with the availability of a macro processor. But with the current music function the compiler keeps getting in my way before I can generate the source code. I just want to output strings into the input stream dynamically, that goes beyond \include files and offers concat, replacement of tokens, and some rudimentary logical constructs, etc. at PRE-compile-time, empasize at PRE-COMPILE-TIME. -- View this message in context: http://www.nabble.com/Macro-pre-processing--t1406795.html#a4182421 Sent from the Gnu - Lilypond - User forum at Nabble.com. _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user