I am just starting with lisp and I can't figure out the following issue:
I want to push *not* elementos into a list, but its *references*, for example, if I write
- Code: Select all
(let (
(a '())
(b '()))
(push 1 a)
(push a b)
(push 2 a)
(print a)
(print b))
I get
- Code: Select all
(2 1)
((1))
and I would like
- Code: Select all
(2 1)
((2 1))
so, each time I modify a, b has to change too.
Is there a way to achieve that?
thanks!!
