> . . . I'd always prefer extensions that do not change the syntax. I can't argue with that preference. But in
> > \foo c \nul 4. % \nul would be a sort of syntactic "breath mark" the "\nul" would not constitute a change in syntax -- "\nul" would simply be another LilyPond keyword. \nul means this: the preceding & following elements are separate items. E.g., here, c \nul 4. is prevented from meaning c4. Most programming languages make whitespace a symbol separator and therefore do need a construct like \nul. But LilyPond accepts c 4. as meaning c4. so LilyPond will sometimes need a separator like \nul. Such a keyword obviously would not need to be called "\nul"; it could be called "\idem" and be thought of as an identity operator: \idem c means c \idem {c8 d e} means {c8 d e} \idem 1*5/8 means 1*5/8 And \foo c \idem 4. means \foo has 2 args: c and 4. -- Tom ************************************************************ On Mon, 8 Jan 2007, Bertalan Fodor wrote: > When I was writing the Antlr version of the parser I realized that > extending the grammar in dozens of ways makes much more complicatons and > unreadability than you gain in compactness. Actually I don't like that I > almost have to reimplement LilyPond just to be able to decide if an > input is syntactically correct. :-) > > So I'd always prefer extensions that do not change the syntax. But I may > be not right. > > Bert > > > ------- Original Message ------- > > From: [EMAIL PROTECTED] > > To: Erik Sandberg <[EMAIL PROTECTED]> > > Sent: 07. 01. 08., 5:54:21 > > Subject: New argument types (Was: Constructive Criticism and a Question) > > > > On Sun, 7 Jan 2007, Erik Sandberg wrote: > > > > > BTW, one of the biggest problems (IMHO) in the lilypond language is that > > > we can't extend the parser to accept durations as parameters to music > > > functions: \foo c 4. is ambiguous; it's unclear whether the 4. is the > > > c's duration, or if it's a separate argument. > > > > It's probably unfortunate that the choice was made to tolerate spaces in > > things like > > c 4. ~ > > but I'm sure that that cannot be undone at this point. > > > > 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. > > > > 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" > > > > -- Tom > > _______________________________________________ > > lilypond-user mailing list > > lilypond-user@gnu.org > > http://lists.gnu.org/mailman/listinfo/lilypond-user _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user