lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do feel people about the following change in syntax?


From: David Kastrup
Subject: Re: How do feel people about the following change in syntax?
Date: Wed, 12 Oct 2011 20:19:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

David Kastrup <address@hidden> writes:

> Graham Percival <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]