lilypond-devel
[Top][All Lists]
Advanced

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

Re: proposals for LM B. Scheme tutorial


From: Carl D. Sorensen
Subject: Re: proposals for LM B. Scheme tutorial
Date: Sat, 20 Jun 2009 19:14:26 -0600



On 6/20/09 2:17 PM, "Mark Polesky" <address@hidden> wrote:

> 
> 
> Here are some proposed additions to LM B. Scheme tutorial

Good for you!  Thanks!

> 
> ***new paragraph and example:
> Multiple consecutive scheme expressions in a music file can be
> combined using the *begin* operator. This reduces the number of
> hash marks to one. However, within such a combined expression,
> LilyPond comments ("%" and "%{ %}") will produce errors.
> 
>     #(begin
> 
>     (define foo 0)
>     (define bar 1)
> 
>     )
> 

I think you should split up the two concepts in the above:

1) LilyPond comments can't be included in Scheme expressions

2) (begin ... ) is used to combine sequential Scheme expressions

LilyPond comments will fail inside of *any* Scheme expression, not just
(begin ... )

i.e. 

#(define (foo bar baz)
(let ((bar 2)
% This is a LilyPond comment
      (baz 3))
% This is too
  (+ bar baz)))

Will also throw errors.

You may also wish to include a third concept:

3) if # is followed by (, the parser remains in Scheme mode until a matching
) is found.

> ***new sentence and example:
> Comments in Guile Scheme are entered as follows:
> 
>     ; this is a single-line comment
> 
>     #!
>     this a (non-nestable)
>     guile-style block comment
>     !#

I think we shouldn't introduce block comments, but I don't feel strongly
about it.

If we do introduce block comments, we should mention that the LilyPond
source doesn't use block comments.



> 
> ***back to current:
> For the rest of this section, we will assume that the data is
> entered in a music file, so we add #s everywhere.
> 
> 
> ************
> 
> 
> ...and maybe at the end, some info regarding using the display
> function within a music file to emulate a guile "sandbox".
> See the thread at:
> http://lists.gnu.org/archive/html/lilypond-devel/2009-06/msg00436.html
> 

Also, probably add that you can get a guile interpreter in most systems by
opening a terminal window and typing guile.



This is good stuff, Mark.  Thanks for your contributions!


Carl





reply via email to

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