Urs Liska <[email protected]> writes: > Am 02.03.2017 um 22:28 schrieb [email protected]: >> Is it possible to convert a symbol (such as `'bes'`) to a pitch (in >> this case `(ly:make-pitch 1 0 0)`)? I know you can do `#{ bes' #}` to >> get a pitch, but that only appears to work for constants. >> >> Or, for a more general question: is there some way to eval() a string >> as Lilypond code? > > I'm not fully sure what you really want to achieve, but this works: > > { > #(ly:parser-include-string "bes") > } > > and may help you further.
It doesn't, really. Try #(display (ly:parser-include-string "bes")) ly:parser-include-string instructs the LilyPond parser (actually the lexer) to process the string "bes" next instead of whatever it was going to process next. It returns no value. And the string is only processed once the Scheme expression finishes. This is nice for triggering LilyPond stuff after the Scheme expression ends. But not much use for evaluating expressions. See my separate proposal instead. -- David Kastrup _______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
