Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3027)

Issue 5023044: Implement optional music function arguments (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by dak
Modified:
12 years, 7 months ago
Reviewers:
pkx166h, Ian Hulin (gmail), Reinhold, carl.d.sorensen
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Implement optional music function arguments This allows, say, to define a substitute for \relative that has an optional pitch argument defaulting to f rather than c. pitch = #(define-scheme-function (parser location pitch) (ly:pitch?) pitch) myrelative = #(define-music-function (parser location pitch music) ((ly:pitch? #{ \pitch f #}) ly:music?) #{ \relative $pitch $music #}) \relative c' {c' d e f g a b c} \relative {c' d e f g a b c} \myrelative c' {c' d e f g a b c} \myrelative {c' d e f g a b c} The first uploaded patch is a separate commit with the following description: lexer.ll: Allow push_extra_token to take a Scheme value as well.

Patch Set 1 #

Patch Set 2 : Optional arguments including several in a row, #

Patch Set 3 : Move argument checks into parser, allowing default arguments to go unchecked. #

Total comments: 2

Patch Set 4 : regtests & docs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+343 lines, -100 lines) Patch
M Documentation/changes.tely View 1 2 3 2 chunks +16 lines, -2 lines 0 comments Download
M Documentation/extending/programming-interface.itely View 1 2 3 13 chunks +72 lines, -27 lines 0 comments Download
A input/regression/optional-args.ly View 1 2 3 1 chunk +33 lines, -0 lines 0 comments Download
M lily/include/lily-lexer.hh View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/lexer.ll View 1 2 3 6 chunks +27 lines, -12 lines 0 comments Download
M lily/lily-lexer.cc View 3 chunks +3 lines, -0 lines 0 comments Download
M lily/parser.yy View 1 2 3 12 chunks +180 lines, -37 lines 0 comments Download
M scm/lily.scm View 1 2 3 1 chunk +10 lines, -20 lines 0 comments Download

Messages

Total messages: 18
Reinhold
Regtest is missing (doesn't need to be a useful example, it just needs to break ...
12 years, 7 months ago (2011-09-15 10:45:11 UTC) #1
dak
On 2011/09/15 10:45:11, Reinhold wrote: > Also, does this work for cases like > \relative ...
12 years, 7 months ago (2011-09-15 13:23:41 UTC) #2
dak
http://codereview.appspot.com/5023044/diff/2001/lily/parser.yy File lily/parser.yy (right): http://codereview.appspot.com/5023044/diff/2001/lily/parser.yy#newcode1184 lily/parser.yy:1184: | EXPECT_MARKUP EXPECT_OPTIONAL function_arglist function_markup_argument { On 2011/09/15 10:45:11, ...
12 years, 7 months ago (2011-09-15 13:23:57 UTC) #3
dak
http://codereview.appspot.com/5023044/diff/2001/scm/music-functions.scm File scm/music-functions.scm (right): http://codereview.appspot.com/5023044/diff/2001/scm/music-functions.scm#newcode792 scm/music-functions.scm:792: " On 2011/09/15 10:45:11, Reinhold wrote: > Here you ...
12 years, 7 months ago (2011-09-15 15:18:08 UTC) #4
Ian Hulin (gmail)
Looks pretty cool, apart from some involved Scheme which I couldn't really unravel totally (see ...
12 years, 7 months ago (2011-09-15 19:44:41 UTC) #5
pkx166h
Fails make --snip-- Backtrace: In unknown file: ?: 0* [primitive-load-path "documentation-generate.scm"] In /home/jlowe/lilypond-git/build/out/share/lilypond/current/scm/documentation-generate.scm: 72: 1* ...
12 years, 7 months ago (2011-09-15 20:17:00 UTC) #6
dak
http://codereview.appspot.com/5023044/diff/9001/scm/document-identifiers.scm File scm/document-identifiers.scm (right): http://codereview.appspot.com/5023044/diff/9001/scm/document-identifiers.scm#newcode33 scm/document-identifiers.scm:33: (format $f "(~a)" (type-name pred))))) On 2011/09/15 19:44:41, Ian ...
12 years, 7 months ago (2011-09-15 21:29:20 UTC) #7
dak
On 2011/09/15 21:29:20, dak wrote: > http://codereview.appspot.com/5023044/diff/9001/scm/document-identifiers.scm > File scm/document-identifiers.scm (right): > > http://codereview.appspot.com/5023044/diff/9001/scm/document-identifiers.scm#newcode33 > ...
12 years, 7 months ago (2011-09-15 23:12:31 UTC) #8
dak
ianhulin44@gmail.com writes: > Looks pretty cool, apart from some involved Scheme which I couldn't > ...
12 years, 7 months ago (2011-09-19 12:36:52 UTC) #9
dak
Next round. Getting past shift/reduce conflicts required adding precendences to every terminal token that can ...
12 years, 7 months ago (2011-09-20 23:24:56 UTC) #10
Carl
I'd be lying if I said I understood everything going on here, but I think ...
12 years, 7 months ago (2011-09-20 23:43:29 UTC) #11
dak
Carl.D.Sorensen@gmail.com writes: > I'd be lying if I said I understood everything going on here, ...
12 years, 7 months ago (2011-09-21 06:27:59 UTC) #12
pkx166h
Not sure what tracker (if any) issue this is but it now passes make and ...
12 years, 7 months ago (2011-09-22 19:37:36 UTC) #13
dak
Pushed as 83055a30e52c14b0fd49d6df3eb1c7af476ecb4b
12 years, 7 months ago (2011-09-22 20:11:52 UTC) #14
dak
Regtests and docs are there. The last upload, however, seems to have influences from a ...
12 years, 7 months ago (2011-09-23 22:19:22 UTC) #15
dak
Pushed as b4ff85a2416e4b80deb9eef8329cd230ee4dc944 and preceding.
12 years, 7 months ago (2011-09-24 05:25:59 UTC) #16
Ian Hulin (gmail)
http://codereview.appspot.com/5023044/diff/22001/scm/ly-syntax-constructors.scm File scm/ly-syntax-constructors.scm (right): http://codereview.appspot.com/5023044/diff/22001/scm/ly-syntax-constructors.scm#newcode52 scm/ly-syntax-constructors.scm:52: (format #f (_ "~a function can't return ~a") (_ ...
12 years, 7 months ago (2011-09-25 22:25:35 UTC) #17
dak
12 years, 7 months ago (2011-09-26 07:46:40 UTC) #18
http://codereview.appspot.com/5023044/diff/22001/scm/ly-syntax-constructors.scm
File scm/ly-syntax-constructors.scm (right):

http://codereview.appspot.com/5023044/diff/22001/scm/ly-syntax-constructors.s...
scm/ly-syntax-constructors.scm:52: (format #f (_ "~a function can't return ~a")
On 2011/09/25 22:25:35, Ian Hulin (gmail) wrote:
> (_ "~a function cannot return ~a")
> Sounds more official and serious and less chatty than "can't". 

Picking German as one of the more complete catalogs:

$ git grep -c "can't" po/de.po
po/de.po:12
$ git grep -c "cannot" po/de.po
po/de.po:63
$ git grep -c "can not" po/de.po
po/de.po:2

Does not seem like that policy is kept perfectly consistent.  On the other hand,
I have to admit being surprised that we use the predominantly British spelling
here while using "color" exclusively and preferring "neighbor" over "neighbour"
3:1 and using "centre" almost only in the translations.

I'll do the change soonish.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b