Can I eval a value in quote?

2018-05-31 01:17:17

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?

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")

  • 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")

    2018-05-31 02:57:39