lilypond-user
[Top][All Lists]
Advanced

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

RE: unpacking a list


From: Mike Solomon
Subject: RE: unpacking a list
Date: Sat, 28 Nov 2015 10:27:27 +0200

Check out:

http://stackoverflow.com/questions/28753729/how-to-manually-flatten-a-list-in-racket-scheme

Cheers, 
~Mike


Sent from my Samsung Galaxy smartphone.
-------- Original message --------
From: Urs Liska <address@hidden>
Date: 28/11/2015 10:24 AM (GMT+02:00)
To: lilypond-user <address@hidden>
Subject: unpacking a list

Hi all,

I don't seem to find a way to "unpack" a list. I think I won't explain
the background, but basically what I need is that
    (list (list 1 2 3) 4)
becomes
    (list 1 2 3 4)

This is a mock-up of my real code:

#(define (func-a)
   (list 1 2 3))

#(define (func-b)
   (list
    (func-a)
    4))

#(display (func-b))

What I need is that the call to (func-a) doesn't evaluate to a list but
to its elements.
I have "solved" it by actually using something like
    (append (func-a) (list f4))
but I think that's not really clean. I'd prefer directly "unpacking" the
list in situ.

Any suggestions?

TIA
Urs


_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user

reply via email to

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