Hi everyone,

Im just getting started learning Nim. Im having trouble with the following:
    
    
    type
      Person = ref object of RootObj
        name: string
    
    # define "value-equality" for Person type
    proc `==`(x,y: Person): bool =
      x.name == y.name
    
    write(stdout, $(Person(name:"Joe") == Person(name:"Joe")))
    
    
    Run

I define == for the Person type to be value-equality. But how can I sometimes 
choose value-equality and other times reference equality? In other words, how 
do I check if 2 objects are the same instance even if I have defined a 
value-equality == proc?

Regards Rouan

Reply via email to