The delayed answers may indicate that it is hard to see what you really intent.

Of course there is no special id field present for all data types in Nim -- for 
a plain int with bytesize 4 or 8 that field would double storage consumption 
and decrease computing performance. For real objects we may have used an id 
field, but why should one. And for your custom objects you can add whatever 
field you desire.

Note that in computers nearly all instances of data types have addresses in 
memory, so you may use them for your is:
    
    
    proc main =
      
      var a: int
      var b: ref int = new int
      
      echo cast[int](a.addr)
      echo cast[int](b.addr)
    
    main()
    
    
    Run

Reply via email to