-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 - -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Friday 15 August 2008 00:21:43 you wrote: > 2008/8/14 Reinhold Kainhofer <[EMAIL PROTECTED]>: > > Here's my attempt, which defines a \harp-pedal #"^v-|^--v" markup > > command (plus a version, which takes a list of 1, 0, -1 and #\| - > > unfortunately that version has some caveats as detailled in the > > .ly file). > > Gee, you're fast. I never had a chance to implement this myself and > push it before you; Gee, sorry for being enthusiatic about implementing this ;-) > I'm still trying to understand this lambda > thing I probably should have given a simple example. The following two do the same. The first example uses an explicitly defined function and applies that function to every every element of your-list. The second does the same, but does not define a separate function, but names the operations of the function lambda and directly applies them: 1) Function definition (simply adds 3 to its parameter and returns it) (def (myfunc param) (+ param 3)) ; apply this function to every element in the list: (map myfunc '(1 2 3 4 5)) ; The result is: '(4 5 6 7 8) 2) The same with a lambda function: (map (lambda (x) (+ x 3)) '(1 2 3 4 5)) Basically, instead of giving the (+ x 3) a function name, you directly insert this code instead of teh function name and tell scheme that x is a variable. That's the whole magic of lambda functions You can either define a function and not use lambda functions at all. But if it's very short and very specialized, you probably don't want to wast a complete function on this task, and that's where lambda functions come in: Instead of defining a separate function, you simply tell Scheme to do some operations (which you put together into one block and call them lambda) on all elements of the list. So basically, a (lambda (varnames...) commands) can be used just like a function name. Since functions take arguments, the first argument of (lambda ) tells scheme the names of the variables. > I haven't read all the code yet, but I do think you should check if > the fourth character in the entry string is a pipe; that would make > the users more comfortable. Okay, I can do this... > One more possible improvement: if you look well at the jpeg sample > Steve provided us with in the first place, you'll see that the > vertical line is actually at the middle of the horizontal line If you look a little closer, it is not exactly in the middle. The reason is that each of the box and divider glyphs of the font have the same with, but the space on the left is a little larger than to the right of the boxes and the divider, thus making it look asymmetric. I searched the web for harp pedal diagrams, but only found very few, all of which where asymmetric... > > Should this be included in git? > > Oh, you bet it should! :) ;) Hehe, It simply feels much better if others tell you that it should be included rather than you yourself try to push it and possibly meet some opposition ;) cheers Reinhold - - -- - - ------------------------------------------------------------------ Reinhold Kainhofer, Vienna University of Technology, Austria email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/ * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/ * K Desktop Environment, http://www.kde.org, KOrganizer maintainer * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/ - -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIpWtiTqjEwhXvPN0RAj8gAJ0X7hFhQhrLHAtAC161nWiCfYw36QCdFkwO 7MiZNzynOcbTXnjHzF7C7G8= =c43n - -----END PGP SIGNATURE----- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIpWvHTqjEwhXvPN0RApVSAJ9TDtkfR/genk2v2EWfTMWNePrgawCgjRG9 IBRX/aaakxbk5pwXQXH+qWs= =83YT -----END PGP SIGNATURE----- _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel