>
> > \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!
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to