Re: scheme: working in guile but not in lilypond?

2012-04-21 Thread Gilles
\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? %% Well, if you change #(set-new-alist! lst '(1 2 3)

Re: scheme: working in guile but not in lilypond?

2012-04-21 Thread David Kastrup
Thomas Morley writes: > 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

scheme: working in guile but not in lilypond?

2012-04-21 Thread Thomas Morley
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: \v