method save () =
      match file with
        None -> self#save_as ()
      |        Some f -> self#save_to_file f