I have a variable with some common values between dap-mode
debug templates and I want to use that variable along with other cons elements for :environment-variable
in languages like Golang or Typescript you would do something like this:
variable = [1, 2, 3]
another_variable = [...variable, 4, 5, 6]
then another_variable
will carry the value of [1, 2, 3, 4, 5, 6]
How can I do this in Emacs Lisp?
EDIT: I know how you can evaluate something inside a list, this is using the backquote, my problem was that I didn't know how Elisp processes lists in a fashion that keep the result plain because, for instance in Python, you can end with something like [1, [2, 3, 4]]
if x
is [1]
and you do x.append([2, 3, 4])
; I didn't know that ,@
was a thing and that neither append
keeps a plain list.