How do I get the address of an object obj
as a plain string? The pointer_from_objref()
function is close to what I want, but when I print the result I get "Ptr{Void} @0x00007f3864c40038"
instead of "0x00007f3864c40038"
. Of course, I could simply discard the first 11 characters, but I feel like there should be a more elegant solution.
The motivation for this question is that I am working on an adjacency list based graph library, centred around the type
immutable Vertex
neighbors::Vector{Vertex}
end
At the moment, printing a single vertex recursively prints the entire graph, which is very inconvenient. Instead, I would like print(v)
to result in Vertex 0x00007f3864c40038
.