Olivier Biot <[email protected]> writes:

> On Sun, Jan 6, 2013 at 12:28 AM, David Kastrup <[email protected]> wrote:
>
>> Olivier Biot <[email protected]> writes:
>>
>> > Is this double meaning of curly braces documented somewhere? I did
>> > not come across it in the online manuals so far.
>>
>> What double life?  Within music, curly braces create sequential
>> music.  What other meaning do you see?
>
> First meaning of curly braces as "block delimiter", e.g. in:
>
> \score {
>   % Serial or parallel music goes here
>   \layout {
>     % Layout directives go here
>   }
> }
>
> Second meaning as "serial music definition", e.g. as a music expression
> that will be used in a voice within a score block:
>
> theMusic = { c8 d e4-. f2 }

Seriously?  Do you think people are confused by the "double life" of
curly brackets in C?  First meaning as "block delimiter", e.g. in:
struct {
  % declarations go here
  union {
    % and more
  }
}

Second meaning as "serial statement definition", e.g. as a statement
expression that will be used in a statement within a procedure:
main ()
{
  if (x) {
    whatever ();
  }
}

I mean, {} for \score and \layout are _fixed_ parts of the syntax.
Using () for function calls as well as expression grouping is more
confusing than that.

> It is very difficult to disambiguate the meaning of the curly braces
> without looking at where they will eventually appear.

That's what is called "syntax".  Scheme, in contrast, gets along without
most of this pesky context-dependent interpretation of lexems, but it
turns out that many people don't consider this an improvement in
legibility.  In fact, it is the most frequent complaint about Scheme.

-- 
David Kastrup

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to