in function parameters, you don't need var keyword. Parameters are passed by 
immutable reference by default, only when you want to change the argument in 
the function you need the var declaration.
    
    
    type
      animal = object of RootObj
      dog = object of animal
      cat = object of animal
    
    method say(self: animal) = discard
    method say(self: dog) = echo "woof!"
    method say(self: cat) = echo "meow?"
    
    proc make_noise(a: animal) =
      a.say; a.say; a.say
    
    proc main =
      let d = dog()
      let c = cat
      d.make_noise
      c.make_noise
    
    main()
    

Reply via email to