Skip to main content
Became Hot Network Question
Fix tags
Link
Basil
  • 12.6k
  • 44
  • 70
add explanation
Source Link
shackra
  • 2.8k
  • 20
  • 51

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.

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?

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.

edited tags
Source Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

I have a variable with some common values between dap-modedap-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]

Is there a way toHow can I do this in Emacs Lisp?

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]

Is there a way to do this in Emacs Lisp?

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?

Source Link
shackra
  • 2.8k
  • 20
  • 51
Loading