fork download
  1. type
  2. Person = object
  3. name: string
  4. age: int
  5.  
  6. proc newPerson(name:string, age=0): Person =
  7. result.name = name
  8. result.age = age
  9.  
  10. let
  11. andrew = newPerson("Andrew", 29)
  12. philip = newPerson("Philip", 27)
  13.  
  14. andrew.greet()
  15. philip.greet()
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.nim(10, 3) Error: expression expected, but found 'let'
stdout
Standard output is empty