Closed adrianholovaty closed 1 year ago
Issue #294 is related — it also concerns empty objects.
It looks fine to me (not from aesthetics but from functionality). Here the default Falsey nature of {}
in Python becomes an advantages, since I'd be likely to parse the global
object with something like:
globals = {}
for i, obj in enumerate(global):
if not obj: # falsy - no attributes.
continue
measure_global = MeasureGlobal(obj)
globals[i] = measure_global
We had a great conversation with some alternates and nothing came better than this way.
We've just discussed this in our co-chairs meeting and haven't been able to find any better options, so let's mark this as Good Enough.
The
"global"
object of an MNX document contains a"measures"
array, with global information on each measure. At the moment, each measure in the document must be represented by an object — which can result in an array containing lots of empty objects.For example, see the Multimeasure rests example document:
This is a bit inelegant, and I could see it confusing newcomers to MNX. Is there a better solution?
I should note that the XML version of MNX had this same ugliness, with a bunch of empty elements in the
<global>
section.Personally I think it's OK, with the philosophy being that MNX will be created and consumed by programs, but I'm bringing it up in case anybody has an amazing better idea.