On 2019-11-27 14:20, Freeman Gilmore wrote:
 From Extending Lilypond:

guile> (define a 3)
guile> (define b 5)
guile> (if (> a b) "a is greater than b" "a is not greater than b")
"a is not greater than b"

Note missing ")".
No, it's not missing any ")"

In Frescobaldi i tried:

\version "2.19.83"
#(define a 3)
#(define b 5)
#(display (if (> a b) "a is greater than b" "a is not greater than b")
"a is not greater than b"))


What is the code suppose to do?
You define two variables, a and b, and give them a value.
You then compare a and b and if a is greater than b then you write out a text "a is greater than b" if not then you write out a different text "a is not greater than b".

Scheme is a Lisp based language and uses parentheses to group statements.
The number of left parentheses should be the same as the number of right parentheses!!!

Your problem is the line

#(display (if (> a b) "a is greater than b" "a is not greater than b")

It has 3 left parentheses and 2 right parentheses.
Frescobaldi is helpful and shows the matched parentheses when you put the cursor on a a parentheses. Using this help you soon will find the the first left parentheses has no right parentheses.

The error will disappear if you add a right parentheses last on the line
#(display (if (> a b) "a is greater than b" "a is not greater than b"))

// Anders

Reply via email to