Jay Anderson wrote
> Try quasiquote + unquote:
> 
> #(define types
>   `(("one" . ,red)
>     ("two" . ,blue)))
> 
> #(display types) => ((one 1.0 0.0 0.0) (two 0.0 0.0 1.0))
> 
> -----Jay

That does it, or you can use "list" and "cons".  Allow me to provide a tiny
example:

%%%%%%%%%%%%%%%%%%%%%
\version "2.18.2"

#(define types
   `(("one" . ,red)
     ("two" . ,blue)))

#(define typesB
   (list
    (cons "one" red)
    (cons "two" blue)))

#(display (color? (assoc-ref types "one")))

#(newline)

#(display (color? (assoc-ref typesB "one")))

%%%%%%%%%%%%%%%%%%%%%

This displays: 
#t
#t

With either of these the red and blue are not quoted which seems to have
been the problem before.  

-Paul



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Colors-in-alists-tp168384p168405.html
Sent from the User mailing list archive at Nabble.com.

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to