Re: lilypond ./ChangeLog ./darwin.patch Documentati...

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

Re: lilypond ./ChangeLog ./darwin.patch Documentati...

Mats Bengtsson-4
Quoting Graham Percival <[hidden email]>:

> Index: lilypond/Documentation/user/programming-interface.itely
> diff -u lilypond/Documentation/user/programming-interface.itely:1.47
> lilypond/Documentation/user/programming-interface.itely:1.48
> --- lilypond/Documentation/user/programming-interface.itely:1.47 Mon
> Feb  6 01:23:40 2006
> +++ lilypond/Documentation/user/programming-interface.itely Sun Feb
> 19 04:05:00 2006
> @@ -87,11 +87,25 @@
> @{ #(ly:export (make-sequential-music (list newLa))) @}
> @end example
>
> +Scheme code is evaluated as soon as the parser encounters it.  To
> +define some scheme code in a macro (to be called later), use
> +
> +@example
> +#(define (nopc)
> +  (ly:set-option 'point-and-click #f))
> +#(nopc)
> +
> +...
> +\nopc
> +{ c'4 }
> +@end example
> +


Is this really correct? #(define ... ) defines the Scheme function.
#(nopc) runs it. Is \nopc just another syntax for #(nopc) ?

    /Mats



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

Re: lilypond ./ChangeLog ./darwin.patch Documentati...

Graham Percival-2

On 19-Feb-06, at 4:50 AM, Mats Bengtsson wrote:

> Quoting Graham Percival <[hidden email]>:
>
>> Index: lilypond/Documentation/user/programming-interface.itely
>> diff -u lilypond/Documentation/user/programming-interface.itely:1.47
>> lilypond/Documentation/user/programming-interface.itely:1.48
>> --- lilypond/Documentation/user/programming-interface.itely:1.47 Mon
>> Feb  6 01:23:40 2006
>> +++ lilypond/Documentation/user/programming-interface.itely Sun Feb
>> 19 04:05:00 2006
>> @@ -87,11 +87,25 @@
>> @{ #(ly:export (make-sequential-music (list newLa))) @}
>> @end example
>>
>> +Scheme code is evaluated as soon as the parser encounters it.  To
>> +define some scheme code in a macro (to be called later), use
>> +
>> +@example
>> +#(define (nopc)
>> +  (ly:set-option 'point-and-click #f))
>> +#(nopc)
>> +
>> +...
>> +\nopc
>> +{ c'4 }
>> +@end example
>> +
>
>
> Is this really correct? #(define ... ) defines the Scheme function.
> #(nopc) runs it. Is \nopc just another syntax for #(nopc) ?

Er, I confess that I have no idea.  I was trying to summarize the
"Defining shortcuts for scheme code", since it looked like useful
information.  But on second glance, it looks like Han-Wen's solution
involved calling it with #(nopc), while Erik's solution had a different
definition but was called with \nopc.

I'll include both methods.
- Graham



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

Re: lilypond ./ChangeLog ./darwin.patch Documentati...

Mats Bengtsson-4
Graham Percival wrote:

>
> On 19-Feb-06, at 4:50 AM, Mats Bengtsson wrote:
>
>> Quoting Graham Percival <[hidden email]>:
>>
>>> Index: lilypond/Documentation/user/programming-interface.itely
>>> diff -u lilypond/Documentation/user/programming-interface.itely:1.47
>>> lilypond/Documentation/user/programming-interface.itely:1.48
>>> --- lilypond/Documentation/user/programming-interface.itely:1.47    
>>> Mon Feb  6 01:23:40 2006
>>> +++ lilypond/Documentation/user/programming-interface.itely    Sun
>>> Feb 19 04:05:00 2006
>>> @@ -87,11 +87,25 @@
>>> @{ #(ly:export (make-sequential-music (list newLa))) @}
>>> @end example
>>>
>>> +Scheme code is evaluated as soon as the parser encounters it.  To
>>> +define some scheme code in a macro (to be called later), use
>>> +
>>> +@example
>>> +#(define (nopc)
>>> +  (ly:set-option 'point-and-click #f))
>>> +#(nopc)
>>> +
>>> +...
>>> +\nopc
>>> +{ c'4 }
>>> +@end example
>>> +
>>
>>
>>
>> Is this really correct? #(define ... ) defines the Scheme function.
>> #(nopc) runs it. Is \nopc just another syntax for #(nopc) ?
>
>
> Er, I confess that I have no idea.  I was trying to summarize the
> "Defining shortcuts for scheme code", since it looked like useful
> information.  But on second glance, it looks like Han-Wen's solution
> involved calling it with #(nopc), while Erik's solution had a
> different definition but was called with \nopc.
>
> I'll include both methods.
> - Graham


Note that Erik's proposal was just a simple special case of
what's described in 11.1.3 Extending music syntax.

   /Mats


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

Re: lilypond ./ChangeLog ./darwin.patch Documentati...

Graham Percival-2

On 19-Feb-06, at 1:52 PM, Mats Bengtsson wrote:

> Graham Percival wrote:
>> I'll include both methods.
>
> Note that Erik's proposal was just a simple special case of
> what's described in 11.1.3 Extending music syntax.

OK, I won't add both methods.  :)

- Graham



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

Re: lilypond ./ChangeLog ./darwin.patch Documentati...

Han-Wen Nienhuys
In reply to this post by Graham Percival-2
Graham Percival wrote:

>>
>> Is this really correct? #(define ... ) defines the Scheme function.
>> #(nopc) runs it. Is \nopc just another syntax for #(nopc) ?
>
>
> Er, I confess that I have no idea.  I was trying to summarize the
> "Defining shortcuts for scheme code", since it looked like useful
> information.  But on second glance, it looks like Han-Wen's solution
> involved calling it with #(nopc), while Erik's solution had a different
> definition but was called with \nopc.

Erik's solution is the neater one, although Scheme buffs might prefer
mine. Erik's solution

   \nopc

makes a music function. Normally, a music function takes a music
argument, like \compressMusic, but Erik's doesn't take any.

My solution just directly calls the Scheme nopc function.

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


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