lilypond-user
[Top][All Lists]
Advanced

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

scheme set list function


From: Gianmaria Lari
Subject: scheme set list function
Date: Sat, 6 Apr 2019 16:10:14 +0200

I wrote this function

#(define (resetList l) (set! l '()))

that I would like to set a list to an empty list. This is an example of use:

\version "2.21.0"
#(define mylist '(1 2 3))
\markup #(object->string mylist) %this prints (1 2 3)

#(define (resetList l) (set! l '()))
#(resetList mylist)
\markup #(object->string mylist) % this I would like it prints () but it prints (1 2 3)

I think the problem is related to the fact resetList changes mylist locally (sort of) but I have no idea how I can fix it. Any help?

Thank you, g.





reply via email to

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