[Bug 23682] Fix the current [ArrayClass], [] and sequence<T> mess

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23682

--- Comment #13 from Jonas Sicking <jonas@sicking.cc> ---
Some philosophical babble to follow, which may or may not be informative.
Possibly I should have posted this before the two comments above.

I think the reason that this bug in general, and use-case D in particular, is
so complex is due to the lack of "value objects". Or at least due to the lack
of real "immutable objects".

What we're really trying to express isn't some separate array object which
carries its own state. What we're trying to express is a property whose value
happens to be a list of "things" rather than a single "thing". It's unfortunate
that that requires such large changes to how you interact with it.

I.e. we don't say `object.numericProperty.add(1)` or
`object.stringProperty.prepend('foo')`. Instead we say
`object.numericProperty += 1` and `object.stringProperty = 'foo'
+ object.stringProperty`. So why do we have to worry about if it's
`object.arrayProperty.push(val)` vs. `object.arrayProperty =
[...object.arrayProperty, val]`?

That's why it seems like the correct solution to me to have a value
which represents a list of blobs, rather than an object which manages
a list of blobs. And why using frozen arrays to solve a bunch of the use cases
is the best solution we can get right now.

But it's unclear if and when we'll get value objects. And if we do, it's still
very unclear what advantages and disadvantages they will bring. This means that
it's hard to say that value objects is the right solution here.

So I definitely don't think we should block the work in this bug on value
objects. But maybe if we get them we should re-evaluate the decisions made in
this bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Sunday, 28 September 2014 22:36:05 UTC