Am Donnerstag, 11. Februar 2010 19:05:26 schrieb Michael J. O'Donnell: > Here's what I *now think* is correct code O:-) : > > includeIfAbsent = > > #(define-music-function (parser location fileName) (string?) > > (let ((guardName (string-append "Already Got " fileName))) > (if (not (defined? (string->symbol guardName)))
Huh? So you are constructing a string like "Already Got testinclude.ily" and turn that into a symbol? First, I suppose the "Already Got" is there just for testing purposes? (Or are you trying to prevent symbols that start with ../somedir/...?) And second, why don't you simply store the strings in a global list or so? I doubt that the overhead of the (a)list member lookup can have any influence on speed. On the other hand it means one global symbol less per included file. > (ly:parser-parse-string (ly:parser-clone parser) (string-concatenate > (list "\\include \"" fileName "\""))) > > #{ #} Wouldn't it be better to put that only once after the (let...) function? Instead of #{ #} you can also use the scheme construct for an empty music expression: (make-music 'Music 'void #t) In scm/ly-syntax-constructors.scm a (void-music) function is defined, which creates also an empty music expression, but does not set the 'void property... I'm not sure if that would also work, in particulat since collect-music-aux in scm/lily-library explicitly checks for the 'void property and discards the music if 'void is set to #t... So, is this an oversight and 'void #t should / needs to be added to the definition of (void-music)? Cheers, Reinhold -- ------------------------------------------------------------------ Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/ * Financial & Actuarial Math., Vienna Univ. of Technology, Austria * http://www.fam.tuwien.ac.at/, DVR: 0005886 * LilyPond, Music typesetting, http://www.lilypond.org _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel