lilypond-devel
[Top][All Lists]
Advanced

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

Re: Move note names to scm (issue3247041)


From: v . villenave
Subject: Re: Move note names to scm (issue3247041)
Date: Thu, 25 Nov 2010 22:50:53 +0000

On 2010/11/25 15:19:17, Carl wrote:
They may be a bit heavier now, but the amount of storage that the
language
alists take is insignificant compared to LilyPond's overall memory
usage.  I
don't see a problem at all.

It's not just about memory usage: isn't it possible that the lookup time
for every pitches might be increased, even just by a tiny amount? (Not
that I could measure it in any way, but I'm wondering.)

Now that I think about it, I assume that the problem you were having
is that
music functions aren't evaluated during parsing, and that the changes
you need
have to be made during parsing.  So we need to have Scheme functions,
not music
functions.

Not necessarily: after all, predefined-guitar-fretboards.ly is loaded
long after music-functions-init or declarations-init.ly. What did worry
me was the prev-pitchnames variable I previously used: should I declare
this variable at a global level in define-note-names.scm, or locally in
predefined-fretboards.ly?

(The *actual* reason is that I'm a total psycho, and every time I
introduce a new global variable I'm thinking that this will take extra
space in memory, and make the program more bloated -- Gee, I need to
remind myself that I'm not in high school anymore, and that I'm not
writing programs for a 32Ko programmable calculator! :-)

So I think
#(save-and-change-language default-language)
and
#(restore-saved-language)
would handle the situation very nicely.

Indeed, that's quite elegant. I'll get right on it, thanks!

Cheers,
Valentin.

http://codereview.appspot.com/3247041/



reply via email to

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