lispelisp

How to push-back a vector in elisp


I found some instructions to pushback with a vector using a function called vector-push, the problem is that I think it only works with common lisp.

What if I want to push to the back of a vector in elisp? How can I do that?

I'm familiar with C++ where you say something like vector.push_back(element);.

The documentation on vector functions in elisp is quite sparse.


Solution

  • Emacs Lisp does not have extensible vectors.

    You can emulate them, of course, just like you can emulate multidimensional arrays, reinventing the wheel in this day and age is a waste of time.

    Why use an inadequate tool?