Skip to main content
Ctrl+K

Extending LilyPond

  • Why Scheme?
  • Scheme tutorial
  • Extending guide
  • About this document
Français Deutsch
  • GitLab
Français Deutsch
  • Why Scheme?
  • Scheme tutorial
  • Extending guide
  • About this document
  • GitLab

Section Navigation

  • Getting started
  • Expressions
  • Functions
  • Messages
  • Conditions
  • Local variables
  • Lists and anonymous functions
  • Quoting and symbols
  • Pairs and alists
  • Recursion
  • Typing
  • Appendix: Other Scheme resources
  • Scheme tutorial

Scheme tutorial#

This tutorial covers the basics of the Scheme programming language, which is a prerequisite for writing Scheme extensions to LilyPond.

This material originates in a presentation delivered at a virtual conference of French-speaking LilyPond users in 2021.

I would like to thank Urs Liska for his own (unfinished) book on Scheme and LilyPond, which helped me learn Scheme myself, and inspired some parts of this tutorial.

  • Getting started
    • Meeting the Scheme sandbox
    • Inserting Scheme code in a LilyPond file
    • Comments
    • Literals
    • Defining variables
  • Expressions
    • First operations
    • Nesting expressions
    • Formatting code
    • Sequences of expressions
  • Functions
  • Messages
  • Conditions
    • if syntax
    • cond syntax
    • Frequently used tests
    • Combining tests
    • One-armed if
    • On universal truth
  • Local variables
    • let syntax
    • Parenthesizing a let expression
    • Simplifying code with let*
  • Lists and anonymous functions
    • Constructing lists
    • Basic operations
    • Traversing a list
    • Filtering lists
    • Using anonymous functions
  • Quoting and symbols
    • Understanding quoting
    • Quasiquoting
    • Identity of symbols
    • Identity and immutability of literal data
  • Pairs and alists
    • A word on pairs
    • Alists
      • Retrieving a value
      • Modifying values
  • Recursion
    • How recursion works
    • More on lists
    • Tail recursion
    • Named let syntax
  • Typing
    • Dynamic typing
    • Basic type predicates
    • Derived and custom type predicates
  • Appendix: Other Scheme resources

previous

Why Scheme?

next

Getting started

Edit on GitLab
Written by Jean Abou Samra, 2021-2023.
Free to reuse, CC0-licensed.
Created using Sphinx, MyST Markdown and the PyData Sphinx Theme.