David Kastrup <[email protected]> writes: > Graham Percival <[email protected]> writes: > >> What happens if somebody writes >> { \with foo c4 \with bar d4 } >> ? > > Good catch. I don't think we want anything but a syntax error here. > One approach would be not to ignore Scheme expressions in a sequence > unless they evaluate to "unspecified" or at least a limited set of > "ignorable" values. > > More compatible would be the approach that you can omit braces only when > a certain construct is syntactically expected somewhere: if it is to be > produced "foreignly", use # or { ... }. Then > > { { \with foo } c4 { \with bar } d4 } > > would be a music sequence with two Scheme expressions inside getting > ignored, and { \with foo c4 \with bar d4 } would be a syntax error.
On the other hand: why silently ignore a likely side-effect-free expression? It is likely to be a programmer error. So I lean towards ignoring only expressions with "unspecified" value (basically all Scheme assignments) for the first attempt. If tests with real-world documents show this to be too disruptive, one can think about alternatives. One can still mark expressions only used for side-effect with \ignore with the definition ignore = #(define-scheme-function (parser location arg) (scheme?) (set! arg arg)) or similarly (guile seems a bit peculiar with regard to completely omitted function bodies). -- David Kastrup _______________________________________________ lilypond-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-devel
