You can't add to a Nil. Firstly initialize it.
    
    
    proc formatTodos(list: TodoList): string =
      result = ""
      for todo in list.items():
        result.add("Todo: " & todo.desc)
    result.add("\n")
    

(insert Viccini saying: "you fell for one of the classic blunders ....") 

There was talk of making "seq" and other "array like" variables to auto 
initialise to stop this happening.

Not sure if that will make Nim 1.0 or if it will happen at all (or maybe the 
default "not nil" will be the solution)

Reply via email to