[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheme question on strict substitution
From: |
stk |
Subject: |
Re: Scheme question on strict substitution |
Date: |
Thu, 30 Nov 2006 15:32:50 -0500 (EST) |
Hello,
> . . . one problem is that this [giving the syntax of each keyword] would
> still just tell a small part of the full syntax.
I think it would give a big part of the full syntax, even if not the whole
picture. It would enable a user to know
(1) what type of "arguments" have to follow the keyword;
(2) whether (s)he has accidentally omitted one of the required
arguments (when debugging);
(3) whether (s)he should write a macro definition or a function
definition to specify a "\whatever" construct involving the
keyword;
(4) what the types should be in the event that (s)he winds up writing a
function definition.
"Full" or not, that's a lot of useful information. And I'm talking about
just a list of the syntax for each keyword, *not* the semantics. A syntax
specification can be short but still tremendously useful. Specification
of the semantics takes a lot of blah-blah, and nobody would have the time
to write up all the semantics.
> Another problem is that the
> rule I gave really was too simple. For example, you cannot say
> ^"some text" in a .ly file
> without having a note in front of it, still you can define a macro
> mytext = ^"some text"
> and then use it as c \mytext
That's a general problem in LilyPond, knowing what kind of expression
constitutes a valid right-hand side of a macro definition. (I'm amazed
that the above definition works.)
A different but related problem concerns something I don't know the right
term for, something like "context-free equivalence" maybe: for example,
I can say
foo = \markup { \bold "Zanzibar" }
bar = \markup { "Stand on" \foo }
but I can't say
bar = \markup { "Stand on" \markup { \bold "Zanzibar" } }
You will object that I would have no *reason* to say that anyway,
but it nevertheless constitutes a toy example of non-transferability:
\foo is not equivalent to \markup { \bold "Zanzibar" }
despite the "=" sign in the macro definition, and that's surprising.
-- Tom
-----------------------------------------------
On Thu, 30 Nov 2006, Mats Bengtsson wrote:
> address@hidden wrote:
> > Hello,
> >
> >
> >> It may help your understanding to know
> >> that \tweak itself is implemented as a music function taking 3 arguments.
> >>
> >
> >
> >> The syntax of \tweak is
> >> \tweak symbol value music_expression
> >>
> >
> > OK, thank you, that's very clear. That fact, for any given keyword,
> > would tell a user immediately whether (s)he could just write a macro or
> > would be forced to define a function for some expression involving the
> > keyword.
> >
> > Is the information
> > (1) number of arguments
> > or preferably
> > (2) the syntax
> > documented explicitly anywhere for all keywords?
> >
> As already said, this is not available in the current manual and one
> problem is that
> this would still just tell a small part of the full syntax. Another
> problem is that the
> rule I gave really was too simple. For example, you cannot say ^"some
> text" in a .ly file
> without having a not in front of it, still you can define a macro
> mytext = ^"some text"
> and then use it as c \mytext
>
>
> /Mats
- Re: Scheme question on strict substitution, (continued)
- Re: Scheme question on strict substitution, Werner LEMBERG, 2006/11/29
- Re: Scheme question on strict substitution, Mats Bengtsson, 2006/11/29
- Re: Scheme question on strict substitution, stk, 2006/11/30
- Re: Scheme question on strict substitution, Mats Bengtsson, 2006/11/30
- Re: Scheme question on strict substitution, stk, 2006/11/30
- Re: Scheme question on strict substitution, Mats Bengtsson, 2006/11/30
- Re: Scheme question on strict substitution,
stk <=
- Re: Scheme question on strict substitution, Han-Wen Nienhuys, 2006/11/30