Jan Nieuwenhuizen <jann...@gnu.org> writes:

> David Kastrup writes:
>
>>> Ah, I was unclear.  Right.  LilyPond stands out /together/ with Perl in
>>> unreadability; these are the only two languages I know that can have
>>> functions look like statements.
>>
>> Hm?  Scheme, C, C++, awk, Lua...
>
>                 C           Perl      Ly
>   postfix:   foo.bar      foo->bar   a\staccato
>   function:  foo.baz ()   foo->baz   \relative a
>
> Consider this valid .ly file
>
>     \new Staff {
>       \relative \ff a \staccato b \pp \parenthesize \skip 1
>     }

Well, the optional argument for \relative is something we should have
sent to heck years ago.  f would have been a nicer default value anyway
(it makes the first element of \relative's argument be in absolute
pitch).

>     % INVALID, can you guess why?
>     %\new Staff {
>     %  \relative a \ff \staccato b \pp \parenthesize \skip 1
>     %}

Sure.  \ff \staccato are events without a place to go.  \relative a \ff
actually is accepted because LilyPond does not double-check that after
identifying a music function to be in non-post-event syntax that it
does, indeed, after calling return a non-post-event.  I think I will
likely implement a warning for that soonish.  Or get the syntax change
done where music functions are _first_ parsed, _then_ interpreted as
postevent or otherwise.

>     \new Staff {
>       \relative c \ff a \staccato b \pp \parenthesize \skip 1
>     }

\relative without delimited second argument is just imprudent.  The
computer language that can prohibit imprudency has not yet been
invented.

>     \new Staff {
>       \relative c \parenthesize a \staccato b \pp \parenthesize \skip 1
>     }

Same here.

>     \new Staff {
>       \relative c-\ff a \staccato b \pp \parenthesize \skip 1
>     }

Interesting case.  Should be equivalent to \relative c \ff since as a
function argument, \ff and -\ff are both valid and identical music
expressions.

>     \new Staff {
>       \relative c c \ff a \staccato b \pp \parenthesize \skip 1
>     }

Again, use braces around c \ff.

> quite hard to guess what will be produced.  For example, why is the
> third stave's a one octave lower?

Because it is not part of \relative.

-- 
David Kastrup

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to