lilypond-user
[Top][All Lists]
Advanced

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

Re: Macro pre-processing?


From: Erik Sandberg
Subject: Re: Macro pre-processing?
Date: Mon, 01 May 2006 19:24:37 +0200
User-agent: Internet Messaging Program (IMP) 3.2.7

Citerar Graham Percival <address@hidden>:

> >> Agreed.  LilyPond is a domain-specific language.  It is rather odd
> >> that it is necessary to break out into a different language to do a
> >> great many things.
> 
> > 2) Scheme *is* part of LilyPond language, using #, and scheme "macro 
> > and other
> >    capabilities" are indeed used. what do you think happens when one 
> > writes:
> >
> > pad = #(define-music-function (parser location padding music) (number? 
> > ly:music?)
> >         #{ \once \override TextScript #'padding = #$padding
> >            $music #})
> 
> In Geoff's defense, this kind of construct _is_ more complicated (to an 
> end-user) than it needs to be -- why the define-music-function,

I agree. The topic pops up often enough to prove that the syntax _does_ scare
away users from using music functions. Even if users "shoudln't need" to be
prohibited by the syntax, they are.

> why the 
> "parser location" (don't bother to explain it to me yet), etc.  It 
> would be easier for users if we could just write
> pad = #function (padnum) (number?) %{
>    \once \override TExtScript #'padding = #$padnum
> %}
> (of course, we'd still get complaints about the weird syntax)

Something like this can very easily be constructed with existing lilypond. It
sacrifices flexibility (you can only use music parameters), but is easier to
use and to understand:

foo = #(music-function 3 %{ c4 #1 r8 #2 g16 #3 %})
(foo takes 3 music parameters, #1 #2 and #3).

> That said, my opinion is that users can live with it.  Do the blind 
> copy-and-paste thing; change the "TextScript" to "DynamicLineSpanner" 
> or whatever you need; it's not a big deal.

I don't want to cut and paste things I don't understand; when I was new to lily
I didn't like grob property tweaking because I didn't understand where the ':s
came from. It's IMHO a good thing to abstract the syntax to a level where users
easily can understand what they are doing.

Erik





reply via email to

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