How can I make fun2
return as the same as fun1
?
(defun fun1 ()
'((hello . "test"))) ; <= returns ((hello . "test"))
(defun fun2 (str)
'((hello . str))) ; <= this is wrong! should return ((hello . "test"))
(defun fun2 (str)
`((hello . ,str)))
See the backquote section of the Emacs manual:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html