Hi, I have started trying nim since last 5 days and I have a small doubt. While I can do
var mittens: ref = new(Animal)
mittens.name = "Mittens"
mittens.species = "P. Leo"
mittens.age = 10
I cannot do mittens.sleep(). Error: type mismatch: got (ref Animal) . What is the way to call a method on a ref. Sorry if it is a very stupid question.
Your first line looks incorrect, just remove the : ref:
var mittens = new(Animal)
mittens.name = "Mittens"
mittens.species = "P. Leo"
mittens.age = 10
Apart from that I can't tell you much more without seeing your full code.