fork download
  1. type Person =
  2. ref object
  3. name: string
  4. age: int
  5.  
  6. proc greet(p:Person) =
  7. echo "Hello, I'm ", p.name, "."
  8. echo "I'm ", p.age, " years old."
  9.  
  10. proc main =
  11. let andrew = Person(name:"Andrew", age:28)
  12. let philip = Person(name:"Philip", age:26)
  13. andrew.greet()
  14. philip.greet()
  15.  
  16. main()
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.nim(2, 12) Error: expression expected, but found 'object'
stdout
Standard output is empty