]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/extending/scheme-tutorial.itely
Doc: ensure two spaces after end of sentence.
[lilypond.git] / Documentation / extending / scheme-tutorial.itely
index 4f498fcaf8920961f6a86589a345a11902c2ae27..c9be04076bff5fa67be6cc47498e8b04baa4f095 100644 (file)
@@ -28,9 +28,9 @@ Scheme.  If you want to know more about Scheme, see
 @uref{http://@/www@/.schemers@/.org}.
 
 LilyPond uses the GNU Guile implementation of Scheme, which is
-based on the Scheme @qq{R5RS} standard. If you are learning Scheme
+based on the Scheme @qq{R5RS} standard.  If you are learning Scheme
 to use with LilyPond, working with a different implementation (or
-referring to a different standard) is not recommended. Information
+referring to a different standard) is not recommended.  Information
 on guile can be found at @uref{http://www.gnu.org/software/guile/}.
 The @qq{R5RS} Scheme standard is located at
 @uref{http://www.schemers.org/Documents/Standards/R5RS/}.
@@ -68,7 +68,7 @@ Scheme.  On most systems you can experiment in a Scheme sandbox by
 opening a terminal window and typing @q{guile}.  On some systems,
 notably Windows, you may need to set the environment variable
 @code{GUILE_LOAD_PATH} to the directory @code{../usr/shr/guile/1.8}
-in the LilyPond installation. For the full path to this directory
+in the LilyPond installation.  For the full path to this directory
 see @rlearning{Other sources of information}.  Alternatively, Windows
 users may simply choose @q{Run} from the Start menu and enter
 @q{guile}.
@@ -519,6 +519,11 @@ guile> (less-than-ten? 15)
 
 @subheading Return values
 
+Scheme procedures always return a return value, which is the value
+of the last expression executed in the procedure.  The return
+value can be any valid Scheme value, including a complex data
+structure or a procedure.
+
 Sometimes the user would like to have multiple Scheme expressions in
 a procedure.  There are two ways that multiple expressions can be
 combined.  The first is the @code{begin} procedure, which allows
@@ -638,6 +643,17 @@ For the rest of this section, we will assume that the data is entered
 in a music file, so we add @code{#}s at the beginning of each Scheme
 expression.
 
+All of the top-level Scheme expressions in a LilyPond input file can
+be combined into a single Scheme expression by the use of the
+@code{begin} statement:
+
+@example
+#(begin
+  (define foo 0)
+  (define bar 1))
+@end example
+
+
 @node LilyPond variables
 @subsection LilyPond variables
 
@@ -808,7 +824,7 @@ while @code{twentyFour} is a variable.
 @subheading Offsets
 
 Two-dimensional offsets (X and Y coordinates) are stored as @code{pairs}.
-The @code{cdr} of the offset is the X coordinate, and the @code{cdr} is
+The @code{car} of the offset is the X coordinate, and the @code{cdr} is
 the Y coordinate.
 
 @example
@@ -1119,7 +1135,7 @@ Now we examine the input,
 @end example
 
 So in our function, we need to clone this expression (so that we
-have two notes to build the sequence), add @code{SlurEvents} to the
+have two notes to build the sequence), add a @code{SlurEvent} to the
 @code{'elements} property of each one, and finally make a
 @code{SequentialMusic} with the two @code{EventChords}.