lilypond-user
[Top][All Lists]
Advanced

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

Re: New argument types (Was: Constructive Criticism and a Question)


From: stk
Subject: Re: New argument types (Was: Constructive Criticism and a Question)
Date: Mon, 8 Jan 2007 05:25:32 -0500 (EST)

> >    \foo c \nul 4.  % \nul would be a sort of syntactic "breath mark"
> >    \foo c \ 4.     % \ -- same idea as \nul (short, but maybe risky?)
> >    \foo c \\ 4.    % \\ -- same as \nul
> >    \foo c =4.      % = prefixed to any expression: "this is separate item"

> . . . If we should add a new syntactical
> element for durations, then we should look for some symbol on the keyboard
> that isn't already used in the current syntax.

I wasn't proposing a symbol to indicate a duration, but rather a spacing
symbol that would indicate that two elements *such as* c and 4. were
separate items, i.e., not equivalent to "c4."

As regards a symbol on the keyboard that isn't already used, that's pretty
hard to find.

> . . . I definitely don't like the idea of reusing
> symbols like \ or \\ or = to have several different meanings in different
> syntactical constructs. For example, I think this is one of the big problems
> with the C++ programming language.

OK; using \nul to indicate separation of two elements would not involve
adding a new meaning to the symbol "\"; it would involve adding a new
keyword.

I don't disagree with your desire to avoid situations where a given symbol
has different meanings in different contexts, but LilyPond does already
have a certain amount of this kind of thing --
-- c4.-.
-- "(" used in Scheme expressions and for slurs
-- "*" used in durations and in expressions to override autobeaming
-- the two "#" in ##t do not signify the same thing
Your point might be that all this is already bad enough, let's not make it
any worse -- and I guess I would have to agree that you have a point.

> > Increasing the number of different argument types for music functions
> > would almost certainly be extremely useful for users . . .

> I doubt that the number of argument types is any major problem.

Maybe I misunderstood Erik's statement that "There are three types of
arguments to music functions: Music, Markup, and Scheme."  I realize that
Scheme arguments are a catch-all for many kinds of arguments, but Scheme
expressions are cumbersome, and having types for more of certain common
things (for example, Fraction for 2/3 and 3:2) is something that users
might find helpful.

-- Tom

************************************************************

On Mon, 8 Jan 2007, Mats Bengtsson wrote:

> address@hidden wrote:
> > Increasing the number of different argument types for music functions
> > would almost certainly be extremely useful for users, who, judging from
> > this mailing list, seem to have an unlimited imagination when it comes to
> > wanting to be able to extend LP syntax.
> >
> >
> I doubt that the number of argument types is any major problem. The
> first big hurdle
> is the Scheme language itself and even if you know Scheme, the next big
> hurdle
> is to figure out the connection between LilyPond and Scheme.
>
> > Since recognizing a duration expression is purely a notational problem
> > (in the sense that a notation has to be found that will be unambiguous for
> > the parser), it might be worth asking for people's ideas.  The things I
> > can think of offhand are the following --
> >
> >    \foo c (4.)     % no good -- confusion with slurs
> >    \foo c \nul 4.  % \nul would be a sort of syntactic "breath mark"
> >    \foo c \ 4.     % \ -- same idea as \nul (short, but maybe risky?)
> >    \foo c \\ 4.    % \\ -- same as \nul
> >    \foo c =4.      % = prefixed to any expression: "this is separate item"
> >
> Sorry to sound so negative, but I definitely don't like the idea of reusing
> symbols like \ or \\ or = to have several different meanings in different
> syntactical constructs. For example, I think this is one of the big problems
> with the C++ programming language.  If we should add a new syntactical
> element for durations, then we should look for some symbol on the keyboard
> that isn't already used in the current syntax.
>
> If you currently want a duration as the input to a music function and
> don't like to use
> (ly:make-duration 2 0) as the argument value, then you can simply use a
> note value (even a spacing note like s2) as the argument and copy the
> duration
> of that one within the music function.
>
>    /Mats





reply via email to

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