> gregorio_glyph.glyph_type is as much an offender as gregorio_note.pitch > in terms of being a multi-purpose field.
Sure > My reason for the enum conversion was to make debugging easier (gdb will > show the enum name rather than a number that needs to be looked up). > Multi-purpose fields mean that you need to understand the context of the > field in order to look up the value. Even if it were a union of enums, > you'd still need to understand the context and remember how it should > apply to understand the output. This is why I abandoned the union idea. ok, understood > The cleanest thing, from an understanding point-of-view, would be to > have fields with a singular purpose in all the structures, but this > makes the structures bulkier with unused fields. Since these structures > hold the entire score, I think this is an acceptable size-leaning > compromise, but a difficult barrier for a new developer to understand. Thinking out loud, many of the problems could be solved by having * a new type for non-notes in gabc parsing * a special_or_note union that would be a pointer to the previous type or a pointer to a note * make gabc parsing determine the good structure on top of that But this is quite a lot of non-funny work... Thank you, -- Elie _______________________________________________ Gregorio-devel mailing list [email protected] https://mail.gna.org/listinfo/gregorio-devel
