def field_list_to_learn_id(p4_field_list):
    ids = field_list_to_learn_id.ids
    if p4_field_list in ids:
        return ids[p4_field_list]
    idx = len(ids) + 1
    ids[p4_field_list] = idx
    return idx