lilypond-devel
[Top][All Lists]
Advanced

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

scheme: working in guile but not in lilypond?


From: Thomas Morley
Subject: scheme: working in guile but not in lilypond?
Date: Sat, 21 Apr 2012 23:49:06 +0200

Hi,

the following code gives me the expected output in guile:

(define-public lst `())
(define (set-new-alist! ls-1 ls-2 proc)
  (for-each (lambda (x) (set! ls-1 (acons x proc ls-1))) ls-2)
  ls-1)
(set-new-alist! lst '(1 2 3) "X")

==> ((3 . "X") (2 . "X") (1 . "X"))

trying similiar in lily:

\version "2.15.36"

#(define-public lst `())
#(define (set-new-alist! ls-1 ls-2 proc)
  (for-each (lambda (x) (set! ls-1 (acons x proc ls-1))) ls-2)
  ls-1)
#(set-new-alist! lst '(1 2 3) "X")
#(display lst)

returns: ()

What am I missing?

-Harm



reply via email to

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