On Oct 25, 2010, at 10:42 AM, Vincent Massol wrote:
Hi,
I'm adding sibling information to the Block API in the rendering module. There are 3
reasons for this:
1) It'll make a lot of existing method implementations much faster since right now in
order to insert or find blocks we have to traverse the list/tree.
2) There's a bug in the current implementation for SpaceBlock since it's
immutable and we have a single instance of it. Thus when there are several SpaceBlock in a
list doing a list.indexOf(SpaceBlock) will always return the first space block even if
you're looking for a subsequent space block.
hmm this point 2) won't work even with the new proposal since there's only one
instance of SpaceBlock, thus previous/nextSibling will be shared everywhere.... The only
solution I can think of to solve this is to remove the immutability of SpaceBlock.
I'll do that. That said, I still think that adding next/previousSibling information
would be positive since it'll solve the performance problem.
Thanks
-Vincent
3) I'm implementing a generic emoticon
Transformation and I need to get the sibling of a block.
Just shout if you think there's a better way of doing it. I'm implementing it
now.
Thanks
-Vincent