lilypond-auto
[Top][All Lists]
Advanced

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

Re: [Lilypond-auto] Issue 4290 in lilypond: Patch: Make Grob::name acces


From: lilypond
Subject: Re: [Lilypond-auto] Issue 4290 in lilypond: Patch: Make Grob::name accessible to Scheme
Date: Sun, 15 Feb 2015 23:38:50 +0000


Comment #4 on issue 4290 by address@hidden: Patch: Make Grob::name accessible to Scheme
https://code.google.com/p/lilypond/issues/detail?id=4290

I had a look in my files where I used a definition for 'grob-name' (more than 30 >times I defined it) and it's use-cases.

Goodness!

Mostly I compare with an other grob-name.
Comparing via eq? is faster than equal? or string=?

In 'all-grob-descriptions' the grob-name is a symbol.

This would point to a symbol as output.

Yes, this is the way I'm leaning too.

Otoh and just trying to be thoroughly, you could let it as is and write another >definiton in lily-library.ly to convert it.

Hmm, I think what I will end up doing is rewriting the function to return a symbol. Grob::name takes a symbol, converts it into a string usable by C++, then ly:grob-name converts this string into a Scheme type. I'd hate to write another function which converts that Scheme string back into the symbol we started out with! It makes a lot of sense to simply return the symbol, and if someone really wants a string--and, come to think of it, I don't believe I ever have--use symbol->string.

A similiar case is 'ly:stencil-in-color' taking single list-entries for a rgb->color and 'stencil-with-color' from stencil.scm taking a predefined color. (Ok, not exactly the same case, but two function aiming the same, taking >different kind of arguments)

This is really confusing. ly:stencil-in-color takes r g b values as separate arguments. meaning that you can't use the color variables, like red and green. However, it actually converts these arguments to a list when it makes the stencil.

stencil-with-color takes the direct route and accepts the color as a list.

Maybe there should just be ly:stencil-in-color which takes a list?
Nevertheless, all in all I'd vote for outputting a symbol.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings



reply via email to

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