Re: [PATCH] Scheme function ly:string->duration

2008-05-18 Thread Neil Puttock
2008/5/18 Joe Neeman <[EMAIL PROTECTED]>: > Sorry, I was under the mistaken impression that sscanf returned the > number of characters that were converted. But given that there's a > scheme function that already does this (should have read the whole > conversation first...) I agree with Nicolas th

Re: [PATCH] Scheme function ly:string->duration

2008-05-17 Thread Joe Neeman
On Sat, 2008-05-17 at 13:31 +0100, Neil Puttock wrote: > Thanks for your comments, Joe. > > I'm struggling a bit with sscanf () though. I tried your suggestion of > > if (sscanf (s.c_str (), "%d") != s.size ()) ... > > but it fails with a segfault; when compiling, I get two warnings: that > the

Re: [PATCH] Scheme function ly:string->duration

2008-05-17 Thread Han-Wen Nienhuys
2008/5/17 Neil Puttock <[EMAIL PROTECTED]>: >> Uh, there is already a duration parsing function in >> scm/define-markup-commands.scm. Why not just make it public and >> rename it? It's a bit too permissive maybe, but still... > > This was my original suggestion to Valentin; I'm quite happy to go >

Re: [PATCH] Scheme function ly:string->duration

2008-05-17 Thread Neil Puttock
2008/5/17 Nicolas Sceaux <[EMAIL PROTECTED]>: > Uh, there is already a duration parsing function in > scm/define-markup-commands.scm. Why not just make it public and > rename it? It's a bit too permissive maybe, but still... This was my original suggestion to Valentin; I'm quite happy to go along

Re: [PATCH] Scheme function ly:string->duration

2008-05-17 Thread Neil Puttock
Thanks for your comments, Joe. I'm struggling a bit with sscanf () though. I tried your suggestion of if (sscanf (s.c_str (), "%d") != s.size ()) ... but it fails with a segfault; when compiling, I get two warnings: that there's not enough arguments to sscanf (), and about type conversion (shoul

Re: [PATCH] Scheme function ly:string->duration

2008-05-16 Thread Nicolas Sceaux
Le 17 mai 08 à 00:16, Joe Neeman a écrit : On Sat, May 17, 2008 at 4:59 AM, Neil Puttock <[EMAIL PROTECTED]> wrote: Hello, In the thread about creating custom metronome markups (http://lists.gnu.org/archive/html/lilypond-user/2008-04/ msg00629.html) and the subsequent discussion at The Lily

Re: [PATCH] Scheme function ly:string->duration

2008-05-16 Thread Joe Neeman
On Sat, May 17, 2008 at 4:59 AM, Neil Puttock <[EMAIL PROTECTED]> wrote: > Hello, > > In the thread about creating custom metronome markups > (http://lists.gnu.org/archive/html/lilypond-user/2008-04/msg00629.html) > and the subsequent discussion at The LilyPond Report, Valentin > expressed the wis

Re: [PATCH] Scheme function ly:string->duration

2008-05-16 Thread Neil Puttock
2008/5/16 Valentin Villenave <[EMAIL PROTECTED]>: > 2008/5/16 Valentin Villenave <[EMAIL PROTECTED]>: > >> Awesome! What is "My First C++ Code"? Looks quite efficient :-) > > Oh, perhaps you meant that this is actually *your* first C++ code :) > Sorry for the noise. Exactly. Thinking about it tho

Re: [PATCH] Scheme function ly:string->duration

2008-05-16 Thread Valentin Villenave
2008/5/16 Valentin Villenave <[EMAIL PROTECTED]>: > Awesome! What is "My First C++ Code"? Looks quite efficient :-) Oh, perhaps you meant that this is actually *your* first C++ code :) Sorry for the noise. Mine was a few weeks ago -- but at a much more modest level: http://code.google.com/p/lily

Re: [PATCH] Scheme function ly:string->duration

2008-05-16 Thread Valentin Villenave
2008/5/16 Neil Puttock <[EMAIL PROTECTED]>: > Attached is a patch with "My First C++ Code", which provides this > functionality. :) Awesome! What is "My First C++ Code"? Looks quite efficient :-) Cheers, Valentin ___ lilypond-devel mailing list lilyp

[PATCH] Scheme function ly:string->duration

2008-05-16 Thread Neil Puttock
7 00:00:00 2001 From: Neil Puttock <[EMAIL PROTECTED]> Date: Fri, 16 May 2008 19:41:36 +0100 Subject: [PATCH] Scheme function ly:string->duration --- lily/duration-scheme.cc | 50 +++ 1 files changed, 50 insertions(+), 0 deletions(-) di