For example, I have a list:
(setq foo '(1 2 3 4 5))
Then I need to get a pointer to its 3rd index element (which contains 4
in the example):
(setq p (SOME_FUNCTION foo 3))
The element with p address can be moved to another list so I can't just save its current foo
's index.
And I need to be able to say later on:
(push 0 foo)
=> (0 1 2 3 4 5)
(setf p 444)
and list foo
must be (0 1 2 3 444 5)
afterwards.
Is this possible in Emacs lisp?
nth
, so you'd get the 3rd element by(nth 2 foo)
– vonbrand Feb 5 '13 at 12:14