0

This question already has an answer here:

I have a variable say some-var, its value is a string. I want to use its value in a quote expression.

'(some-var "some string")

The function who is using the above expression reports error because it gets some-var literally...not the value.

Any trick to eval some-var inside a quote expression?

marked as duplicate by Drew, Stefan, Gilles Jun 1 '18 at 10:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

8

You have two options:

1) Don't use quotes at all, as in:

(list some-var "some-string")

2) Use a backquote. They work like quotes, but part of an expression can be evaluated by using , and ,@. For example:

`(,some-var "some-string")
  • Why I did not think about list at the first place...lol! Thanks. – David S. Jul 1 '16 at 0:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.