Is there a way to get a variable address in Common Lisp?

I am trying to implement XOR-linked lists in Common Lisp, but I need to get the address of a variable to perform any bitwise operations on it. Is there a way to get the memory address of a variable similar to python id () function?

+4
source share
2 answers

Typically, memory management in Common Lisp is done by some sort of garbage collector . Many of these algorithms move objects in memory during the collection cycle.

Thus, the consequence is that you cannot count on a fixed address for each object, and for this reason, the standard operation is not provided to get the address of the Common Lisp object.

+7
source

If you are using Allegro Common Lisp , maybe this is what you are looking for: Exit the heap: low-level programming in general Lisp

0
source

Source: https://habr.com/ru/post/1616520/


All Articles