lilypond-user
[Top][All Lists]
Advanced

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

Re: Ambitus with shape notes


From: Lukas-Fabian Moser
Subject: Re: Ambitus with shape notes
Date: Fri, 25 Aug 2017 19:53:21 +0200

> \version "2.19.44"
>
> #(define (nth n l)
>   (if (or (> n (length l)) (< n 0))
>     (error "Index out of bounds.")
>     (if (eq? n 0)
>       (car l)
>       (nth (- n 1) (cdr l)))))

Seriously?

#(define (nth n l) (list-ref l n))

Of course not - being absolutely foreign to scheme, I searched the web for a solution of the problem "get n-th element of list", and this was what I stumbled upon and used just because it worked. (I don't know why at the place where I found this, list-ref wasn't used - maybe it is a question of dialects?)

Thanks for pointing this out!

reply via email to

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