lilypond-devel
[Top][All Lists]
Advanced

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

RE: Fret Diagram markup


From: Carl D. Sorensen
Subject: RE: Fret Diagram markup
Date: Mon, 17 May 2004 17:38:35 -0600


> -----Original Message-----
> From: Nicolas Sceaux [mailto:address@hidden 
> Sent: Monday, May 17, 2004 1:24 PM
> To: Carl D. Sorensen
> Cc: address@hidden; address@hidden
> Subject: Re: Fret Diagram markup
> 
> 
> The following remarks are purely stylistic. You may want to:
> 
>  - use hyphens in variable and function names, eg subtract-base-fret
>    instead of subtractbasefret;
> 
>  - use less generic names, eg parse-fret-string or fret-parse-string
>    or fret:parse-string instead of parsestring;
> 
>  - not leave parentheses alone on a line, all closing parens should
>    put together at the end of an expression.
> 
> Maybe `format' (the one borrowed from Common Lisp) can do the 
> job of `integer->roman'.
> 
> guile> (integer->roman 23)
> "xxiii"
> guile> (use-modules (ice-9 format))
> guile> (format #f "~(~:@r~)" 23)
> "xxiii"
> 
> ~:@r means write roman number, and ~(...~) means lowercase. 
> See: 
> http://www.gnu.org/software/guile/docs/guile->
ref/Formatted-Output.html
> 
> nicolas
> 
> 

Attached is a new version of fret-diagrams.ly that responds to these
stylistic suggestions.  In particular:

'integer->roman' has been replaced by format

All lines beginning with ')' have been collapsed onto the previous line.

All procedure names have been hyphenated, and where I felt procedure
names were generic, I have tried to make them more specific, generally
by the inclusion of 'fret-'.

In most cases, I left variable names unhyphenated.  I prefer 'dotsize'
to 'dot-size', and variables are all local to the procedure, so I
thought that personal preference could continue there. (Also, I see
multiple examples of non-hyphenated names in existing scheme code).  If
those who are responsible for lilypond standards believe that it's
important to hyphenate all variable names, then I'll be willing to do
so.  If it's not a major concern, then I'll probably leave it as is.

Again, thanks for the careful reading of the code and for the
suggestions on improving style.  I'm glad that others are looking at it
-- perhaps someone will even use it (besides me, of course)!

Carl

Attachment: fret-diagrams.ly
Description: fret-diagrams.ly


reply via email to

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