On 03 Mar 2013, at 10:20, stephane ducasse <stephane.ducasse@free.fr> wrote:
Hi sven
yes I imagine now we should improve in trakcing such changes. In addition I do not understand why
XMLOrderedList new: 10
breaks the inspectorâ¦.
Yes, I once saw that as well, very strange, I guess that is what happens when you start making your own collection classes...
This is why all the important libraries should be covered by a jenkins job and tests. So that right on the spot we can identify problems.
Stef
These important changes were made intentionally, so we need to find the rationale of the change. Like is the new behavior covered by new tests ?
On 03 Mar 2013, at 09:45, stephane ducasse <stephane.ducasse@free.fr> wrote:
On Mar 3, 2013, at 9:42 AM, stephane ducasse <stephane.ducasse@free.fr> wrote:
I could overwrite XMLOrderedList
replaceFrom: aStartingIndex to: anEndingIndex with: aCollection startingAt: aReplacementStart
collection replaceFrom: aStartingIndex to: anEndingIndex with: aCollection startingAt: aReplacementStart
to make it grow? But I do not really know the impact on the XML library
self makeRoomFor: (anEndingIndex- self capacity).
any idea?
In fact it will not work since makeRoomFor: and others have been removed and I do not have the time to dive in OrderedCollection growing logic.
Stef
On Mar 3, 2013, at 9:34 AM, Stéphane Ducasse <Stephane.Ducasse@inria.fr> wrote:
Hi guys
in 1.2.1
OrderedCollection new replaceFrom: 1 to: 5 with: #(6 7 8 9 10) startingAt: 1 gave an OrderedCollection(6 7 8 9 10)
while in 1.4 and 2.0 OrderedCollection new replaceFrom: 1 to: 5 with: #(6 7 8 9 10) startingAt: 1 raised an error
Do you have an idea how I can handle that? Because XMLObservableList and XMLOrderedList implements replaceFrom: to: with: startingAt:
because there is no self makeRoomFor: (stop - self capacity) invocation.
in 1.4>> replaceFrom: start to: stop with: replacement startingAt: repStart "This destructively replaces elements from start to stop in the receiver starting at index, repStart, in the sequenceable collection, replacementCollection. Answer the receiver. No range checks are performed."
| index repOff | repOff := repStart - start. index := start - 1. [(index := index + 1) <= stop] whileTrue: [self at: index put: (replacement at: repOff + index)]
at: anInteger put: anObject "Put anObject at element index anInteger. at:put: cannot be used to append, front or back, to an ordered collection; it is used by a knowledgeable client to replace an element." self ensureBoundsFrom: anInteger to: anInteger. ^array at: anInteger + firstIndex - 1 put: anObject
in 1.2.1
replaceFrom: start to: stop with: replacement startingAt: repStart "An ordered collection is growable, so a call to this can make the collection grow." self makeRoomFor: (stop - self capacity). array replaceFrom: start + firstIndex - 1 to: stop + firstIndex - 1 with: replacement startingAt: repStart. lastIndex := lastIndex max: stop + firstIndex - 1.