code: def write_enum(fo, datum, schema):
      
      index = schema['symbols'].index(datum)
      write_int(fo, index)
docs: An enum is encoded by a int, representing the zero-based position of
      the symbol in the schema.