[Cuis] How do I use Ropes?

H. Hirzel hannes.hirzel at gmail.com
Sat Feb 16 12:20:55 CST 2013


Ken

I think I need a bit more instructions how the class Rope [1] is
supposed to be used.

The test class #RopeTest has


   setUp

	"Set up class variables (before each test)."
	"This could be done once, as Ropes are immutable"
	| testString |
	testString := '1234abcd5678hijk90lm'.
	flatRope := FlatRope fromString: testString.
	"Build SubRope by hand as we need to test constructor"
	subRope := SubRope new initialize string: testString startIndex: 5 length: 12.
	concRope1 := ConcatRope concatenate: subRope with: (' new string tail' asRope).
	concRope2 := ConcatRope concatenate: concRope1 with:concRope1.
	concRope3 := ConcatRope concatenate: ('Now is the time ' asRope) with: subRope.


I actually would expect the class Rope to have
    Rope class >> fromString:

as I do not necessarily want to know about the details.

--Hannes


[1]  https://github.com/KenDickey/Cuis-Ropes




More information about the Cuis mailing list