[patch] clean up scheme rehearsal mark format code

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch] clean up scheme rehearsal mark format code

Erlend Aasland
Hi,

I've done some cleanup of the mark-formatters by adding a helper function. Patch is against 2.7 CVS.

Diffstat output:
 translation-functions.scm |   40 ++++++++++++++++------------------------
 1 files changed, 16 insertions(+), 24 deletions(-)


Regards,
  Erlend Aasland

_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

markformat-cleanup.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [patch] clean up scheme rehearsal mark format code

Nicolas Sceaux
Erlend Aasland <[hidden email]> writes:

> +(defmacro-public def-format-mark-command (type cmd)
> +  (let* ((pfx "format-mark-")
> +         (sfx (symbol->string type))
> +         (ord-cmd (string->symbol (string-append pfx sfx)))
> +         (box-cmd (string->symbol (string-append pfx (string-append "box-" sfx))))
> +         (circle-cmd (string->symbol (string-append pfx (string-append "circle-" sfx)))))
> +  `(begin
> +    (define-public (,ord-cmd mark context) (make-bold-markup (,@cmd)))
> +    (define-public (,box-cmd mark context) (make-bold-markup (make-box-markup (,@cmd))))
> +    (define-public (,circle-cmd mark context) (make-bold-markup (make-circle-markup (,@cmd))))
> +)))

It would be good if `def-format-mark-command' had a detailed
documentation string, especially as it creates symbols to name new
functions.


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: [patch] clean up scheme rehearsal mark format code

Han-Wen Nienhuys
Nicolas Sceaux wrote:

> Erlend Aasland <[hidden email]> writes:
>
>
>>+(defmacro-public def-format-mark-command (type cmd)
>>+  (let* ((pfx "format-mark-")
>>+         (sfx (symbol->string type))
>>+         (ord-cmd (string->symbol (string-append pfx sfx)))
>>+         (box-cmd (string->symbol (string-append pfx (string-append "box-" sfx))))
>>+         (circle-cmd (string->symbol (string-append pfx (string-append "circle-" sfx)))))
>>+  `(begin
>>+    (define-public (,ord-cmd mark context) (make-bold-markup (,@cmd)))
>>+    (define-public (,box-cmd mark context) (make-bold-markup (make-box-markup (,@cmd))))
>>+    (define-public (,circle-cmd mark context) (make-bold-markup (make-circle-markup (,@cmd))))
>>+)))
>
>
> It would be good if `def-format-mark-command' had a detailed
> documentation string, especially as it creates symbols to name new
> functions.

I actually think that this is not a clean up. The original, while
lengthy, was perfectly easy to understand.  I don't why you need to add
(a public!) macro to condense it further. Maybe we should think of a
better interface to the mark formatter. MAybe we could do something like

   markMarkup = \markup  {
     \circle \bold \fromproperty #'context:bar-number
   }

and drop the special markFormatter interface.

Any  takers / sponsors for a patch?

--
  Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: [patch] clean up scheme rehearsal mark format code

Erlend Aasland
Hi

On 8/15/05, Han-Wen Nienhuys <[hidden email]> wrote:
I actually think that this is not a clean up. The original, while
lengthy, was perfectly easy to understand.  I don't why you need to add
(a public!) macro to condense it further.

I agree with that.

Maybe we should think of a
better interface to the mark formatter. MAybe we could do something like

   markMarkup = \markup  {
     \circle \bold \fromproperty #'context:bar-number
   }

and drop the special markFormatter interface.

Yes, that would be a better approach. The lengthy format-mark-whatever-something functions are too many and too long.


Regards,
  Erlend Aasland
 

Any  takers / sponsors for a patch?

--
  Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel