Closed renl closed 7 years ago
Correct, it requires compile-time manipulation to turn it into the right static field. Could you do something like (def white-color (color :white))
instead?
i suppose, I intended to have a create entity helper function where i can specific the color, so in this case the argument for the color in the helper function is kinda a function instead of a keyword.
quick (slightly late) question. Does color have to be a macro? why not just a function?
It may be possible to do what we did with key-code
and turn it into a function by using eval
. I'll look into it when I have the time.
Color is now a function: d4ff20ef086e4533d1d147fba885cf448bc3c1fa
Yey :) much nicer. Thx
Seem like by defining color as a macro, it does not allow the argument of color to be passed in from another function as you check it as keyword.
so (def white-color :white) (color white-color) does not work. Not sure if there a better way.